<?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=Ac2613</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=Ac2613"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Ac2613"/>
	<updated>2026-04-09T16:03:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529562</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529562"/>
		<updated>2016-01-29T08:35:10Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Liquid Simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|Figure 12 - All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png|Figure 13]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png|Figure 14]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png|Figure 15]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png|Figure 16]]&lt;br /&gt;
[[image:AilC MSD Vapour.png|Figure 17]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png|Figure 18]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png|Figure 19]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png|Figure 20]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png|Figures 21, 22 and 23]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png|Figures 24,25 and 26]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid (&#039;&#039;&#039;Figures 22 and 25&#039;&#039;&#039;) returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid (&#039;&#039;&#039;Figures 23 and 26&#039;&#039;&#039;) since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; .&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529561</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529561"/>
		<updated>2016-01-29T08:34:33Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|Figure 12 - All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png|Figure 13]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png|Figure 14]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png|Figure 15]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png|Figure 16]]&lt;br /&gt;
[[image:AilC MSD Vapour.png|Figure 17]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png|Figure 18]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png|Figure 19]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png|Figure 20]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png|Figures 21, 22 and 23]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png|Figures 24,25 and 26]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid (&#039;&#039;&#039;Figures 22 and 25&#039;&#039;&#039;) returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid (&#039;&#039;&#039;Figures 23 and 26&#039;&#039;&#039;) since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; .&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529560</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529560"/>
		<updated>2016-01-29T08:30:08Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Mean Squared Displacement and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|Figure 12 - All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png|Figure 13]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png|Figure 14]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png|Figure 15]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png|Figure 16]]&lt;br /&gt;
[[image:AilC MSD Vapour.png|Figure 17]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png|Figure 18]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png|Figure 19]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png|Figure 20]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529559</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529559"/>
		<updated>2016-01-29T08:28:29Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|Figure 12 - All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png|Figure 13]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png|Figure 14]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529558</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529558"/>
		<updated>2016-01-29T08:24:30Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529557</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529557"/>
		<updated>2016-01-29T08:23:09Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529553</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529553"/>
		<updated>2016-01-29T08:15:27Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&amp;lt;ref name = &amp;quot;book&amp;quot; &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529552</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529552"/>
		<updated>2016-01-29T08:15:13Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]&amp;lt;ref name=&amp;quot;phases&amp;quot;&amp;gt; J-P. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969&amp;lt;/ref&amp;gt;&amp;lt;refname = &amp;quot;book&amp;quot; &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529550</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529550"/>
		<updated>2016-01-29T08:12:28Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Part 5 Heat Capacities of the System */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center|Figure 11]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529548</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529548"/>
		<updated>2016-01-29T08:11:54Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Temperature graphs in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529546</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529546"/>
		<updated>2016-01-29T08:10:57Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Plotting the Equations of State */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Figure 10 - Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529544</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529544"/>
		<updated>2016-01-29T08:10:12Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Running Simulations under Specific Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters (Shown in &#039;&#039;&#039;Table 2&#039;&#039;&#039;) (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529542</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529542"/>
		<updated>2016-01-29T08:09:09Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Checking Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Figure 7 -Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Figures 8 and 9&#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|Figure 8 - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|Figure 9 - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529540</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529540"/>
		<updated>2016-01-29T08:07:59Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Checking Equilibration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Figure 6&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|Figure 6 - Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529539</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529539"/>
		<updated>2016-01-29T08:06:49Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Specifying the timestep */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
The spheres modeled in VMD may change position across the box very rapidly when it reaches one periodic boundary, and is reflected back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529538</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529538"/>
		<updated>2016-01-29T08:05:05Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529537</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529537"/>
		<updated>2016-01-29T08:04:36Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref name=&amp;quot;sd&amp;quot; /&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529536</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529536"/>
		<updated>2016-01-29T08:03:51Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;standarddeviation&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;refsd&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529535</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529535"/>
		<updated>2016-01-29T08:03:35Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;refname=&amp;quot;standarddeviation&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;refsd&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529534</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529534"/>
		<updated>2016-01-29T08:02:04Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC . XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;refname=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;refsd&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529533</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529533"/>
		<updated>2016-01-29T08:01:30Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Periodic Boundary Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC . XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt; &amp;lt;refname=&amp;quot;sd&amp;quot;&amp;gt;A. D. McNaught and A. Wilkinson, IUPAC. Compendium of Chemical Terminology, 2nd ed. Blackwell Scientific Publications, Oxford, 1997&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;sd&amp;lt;/ref&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529532</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529532"/>
		<updated>2016-01-29T07:59:30Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Atomic Forces */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529531</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529531"/>
		<updated>2016-01-29T07:58:53Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Energies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost. &amp;lt;ref name=&amp;quot;laser&amp;quot;&amp;gt; R. LeSar, Introduction to Computational Materials Science, CUP, Cambridge, 2013&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529529</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529529"/>
		<updated>2016-01-29T07:57:10Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529528</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529528"/>
		<updated>2016-01-29T07:56:03Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 - The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529527</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529527"/>
		<updated>2016-01-29T07:55:34Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 (L-R)|Figures 3 and 4]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529525</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529525"/>
		<updated>2016-01-29T07:54:52Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Figures 3 and 4&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|Figures 3 and 4 |The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table 1&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&#039;&#039;&#039;Table 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529523</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529523"/>
		<updated>2016-01-29T07:53:12Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Energies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt;  P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529521</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529521"/>
		<updated>2016-01-29T07:52:03Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Energies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion &amp;lt;ref name=&amp;quot;book&amp;quot;&amp;gt; Springer, 2003&amp;lt;/ref&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529516</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529516"/>
		<updated>2016-01-29T07:49:05Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Background and Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center|Figure 1]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529515</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529515"/>
		<updated>2016-01-29T07:48:44Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Energies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in &#039;&#039;&#039;Figure 2&#039;&#039;&#039; below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure 2]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529514</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529514"/>
		<updated>2016-01-29T07:47:55Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Background and Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &#039;&#039;&#039;Figure 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529513</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529513"/>
		<updated>2016-01-29T07:47:09Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Background and Introduction to Molecular Dynamics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to find the timestep to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529512</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529512"/>
		<updated>2016-01-29T07:12:10Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AmcV0.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF versus time graphs plotted using own data, to a time of 500&lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:AmcV0.png&amp;diff=529511</id>
		<title>File:AmcV0.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:AmcV0.png&amp;diff=529511"/>
		<updated>2016-01-29T07:11:24Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529510</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529510"/>
		<updated>2016-01-29T07:06:19Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF graphs plotted using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AIlVACF Calcs.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF graphs plotted using own data &lt;br /&gt;
&lt;br /&gt;
What do the minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plots are due to collisions occurring between atoms in the system. When two atoms collide, their directions are altered. However, the liquid returns to a &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; more rapidly than a solid since there is less structure in a liquid compared to the denser, more rigid solid structure. Conversely, the harmonic oscillator is modeled as two atoms on a spring, hence the VASF simply oscillates periodically about &amp;lt;math&amp;gt; VACF = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529509</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529509"/>
		<updated>2016-01-29T06:55:48Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF calculated using the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AIlVACF Calcs.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF calculated using own data &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529508</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529508"/>
		<updated>2016-01-29T06:53:52Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Velocity Autocorrelation Function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF calculated suing the data provided&lt;br /&gt;
&lt;br /&gt;
[[image:AIlVACF Calcs.png]]&lt;br /&gt;
&lt;br /&gt;
Above VACF calculated using own data &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529506</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529506"/>
		<updated>2016-01-29T06:52:09Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Mean Squared Displacement and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
[[image:AILVACF Calcs Provided.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:AIlVACF Calcs.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:AIlVACF_Calcs.png&amp;diff=529505</id>
		<title>File:AIlVACF Calcs.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:AIlVACF_Calcs.png&amp;diff=529505"/>
		<updated>2016-01-29T06:51:44Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:AILVACF_Calcs_Provided.png&amp;diff=529503</id>
		<title>File:AILVACF Calcs Provided.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:AILVACF_Calcs_Provided.png&amp;diff=529503"/>
		<updated>2016-01-29T06:50:29Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529496</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529496"/>
		<updated>2016-01-29T06:34:30Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Mean Squared Displacement and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how variable the system is.&lt;br /&gt;
Hence MSD for a solid &amp;lt; liq &amp;lt; vapour.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As expected, the MSD is largest for a gas and smallest for a solid in which the system remains relatively static. Moreover, the MSD equilibrates for a solid since the atoms and sit on fixed lattice points.&lt;br /&gt;
&lt;br /&gt;
The simulated and provided data give concordant results to equivalent or very similar values for each phase. Therefore using a million atoms is not justified in terms of cost for the calculations of MSD. &lt;br /&gt;
&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529494</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529494"/>
		<updated>2016-01-29T06:29:19Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Mean Squared Displacement and the Diffusion Coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how static (or variable) the system is.&lt;br /&gt;
Hence solid &amp;gt; liq &amp;gt; vap.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529493</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529493"/>
		<updated>2016-01-29T06:27:55Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how static (or variable) the system is.&lt;br /&gt;
Hence solid &amp;gt; liq &amp;gt; vap.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529492</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529492"/>
		<updated>2016-01-29T06:27:30Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how static (or variable) the system is.&lt;br /&gt;
Hence solid &amp;gt; liq &amp;gt; vap.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529491</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529491"/>
		<updated>2016-01-29T06:26:47Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Part 4 Running Simulations under Specific Conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how static (or variable) the system is.&lt;br /&gt;
Hence solid &amp;gt; liq &amp;gt; vap.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529490</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529490"/>
		<updated>2016-01-29T06:19:58Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Part 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Part 4 Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Mean Squared Displacement and the Diffusion Coefficient==&lt;br /&gt;
Mean squared displacement calculations model how static (or variable) the system is.&lt;br /&gt;
Hence solid &amp;gt; liq &amp;gt; vap.&lt;br /&gt;
&lt;br /&gt;
The values input for the calculations were as follows:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529489</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529489"/>
		<updated>2016-01-29T06:17:14Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Part 7 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Part 4 Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Part 7==&lt;br /&gt;
Mean squared displacement calculations: how much are the atoms moving around? how static is the system? (solid &amp;gt; liq &amp;gt; vap ..?)&lt;br /&gt;
&lt;br /&gt;
liq.in values..:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Red density = 0.05&lt;br /&gt;
&lt;br /&gt;
T = 0.75&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
Red density = 0.8&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Red density = 1.2&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529488</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529488"/>
		<updated>2016-01-29T06:10:11Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Part 4 Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi \int g(r) r^2 \mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Part 7==&lt;br /&gt;
Mean squared displacement calculations: how much are the atoms moving around? how static is the system? (solid &amp;gt; liq &amp;gt; vap ..?)&lt;br /&gt;
&lt;br /&gt;
liq.in values..:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Red density = 0.05&lt;br /&gt;
&lt;br /&gt;
T = 0.75&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
Red density = 0.8&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Red density = 1.2&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529487</id>
		<title>Rep:Mod:AC2015LQ</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AC2015LQ&amp;diff=529487"/>
		<updated>2016-01-29T06:08:51Z</updated>

		<summary type="html">&lt;p&gt;Ac2613: /* Structural Properties and the radial distribution function (RDS) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Liquid Simulations =&lt;br /&gt;
&lt;br /&gt;
In this experiment the structural and thermodynamics properties of a simple liquid were calculated using molecular dynamics techniques based on a statistical thermodynamics treatment of the system. &lt;br /&gt;
&lt;br /&gt;
==Background and Introduction to Molecular Dynamics==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations are used in this report to calculate thermodynamic properties of various ensembles. The [http://lammps.sandia.gov/ LAMMPS] code was utilised to write these calculations, and they were subsequently performed on the University High Performance Computing (HPC) facilities. There is much history of using large HPC systems (e.g. ARCHER) to measure properties of large data sets, but many approximations must be made.&lt;br /&gt;
&lt;br /&gt;
Here it is assumed that atoms behave as classical particles governed by Newton&#039;s Second Law, i.e.  &amp;lt;math&amp;gt;F = m a&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be adapted to allow a simulation of atomic movement over time - the essence of molecular dynamics simulations. Of course if we were to simulate every individual atom there would be a huge expense in terms of computer processing energy and thus the [https://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet velocity Verlet algorithm] is implemented to give a good approximation to the overall system. &lt;br /&gt;
&lt;br /&gt;
Initial simulations were run to optimise the timestep which is to be used in subsequent calculations.&lt;br /&gt;
&lt;br /&gt;
The file HO.xls provided data for the position &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt;, velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and force &amp;lt;math&amp;gt; f &amp;lt;/math&amp;gt; of a system across a range of time. This may be used to model the behaviour of a classical harmonic oscillator using the velocity-Verlet algorithm mentioned previously. The behaviour was also modelled using the classical method and good agreement between the models visible in &#039;&#039;&#039;Figure X&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:Position 0.1.png|500px|Position versus Time for Timestep of 0.1|center]] &lt;br /&gt;
&lt;br /&gt;
====Energies====&lt;br /&gt;
The energy of the system was calculated from a summation of the potential and kinetic energies:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = E_{kinetic} + E_{potential} = K + U = \frac{1}{2} m v^2 + \frac{1}{2} k x^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; m &amp;lt;/math&amp;gt; is mass (given as 1.00), &amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; is velocity and &amp;lt;math&amp;gt; k &amp;lt;/math&amp;gt; is the force constant (given as 1.00)&lt;br /&gt;
&lt;br /&gt;
Energy must be conserved for the simulation to provide a physically valid model (as per [https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion Newton&#039;s Third Law]). However there is an inherent error in molecular dynamics calculations (due to the approximations that must be made &#039;&#039;&#039;link to later approxs&#039;&#039;&#039;). Hence the energy calculated with MD simulations drifts in accordance with Brownian motion (BOOK REF). &lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet simulation used does not conserve energy but instead keeps it fluctuating about a constant value over long periods of time. Hence the optimal timestep will give a minuscule variation in energy, but at the largest possible timestep to save computational cost.&lt;br /&gt;
&lt;br /&gt;
Timesteps were varied from 0.1 upwards, with the energies and the fluctuations listed in &#039;&#039;&#039;Table X&#039;&#039;&#039;. The Energy versus Time Graph for a timestep of 0.1 is visible in&#039;&#039;&#039;Figure X&#039;&#039;&#039;below,&lt;br /&gt;
&lt;br /&gt;
[[image:Energy 0.1.png|400px|thumb|right|Figure X]]&lt;br /&gt;
&lt;br /&gt;
It was deduced that the simulations were valid for a timestep  &amp;lt;math&amp;gt; \leq &amp;lt;/math&amp;gt; 0.2.  &lt;br /&gt;
&lt;br /&gt;
This is because the average total energy of the oscillator for the velocity-Verlet solution is constant for each timestep at &amp;lt;math&amp;gt;E_{average} = 0.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence to keep the energy within 1% required a fluctuation of less than or equal to 1% of 0.5:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta E \leq 0.5 \times 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the maximum timestep to give an energy fluctuation of less than 1% was determined to be 0.2. (Timestep 0.21 gives a fluctuation greater than 0.5 (1%), with 0.205 also above 1%)&lt;br /&gt;
&lt;br /&gt;
====Errors====&lt;br /&gt;
It was also possible to calculate the error between the &#039;&#039;classical solution&#039;&#039; for the position at time &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt; and the position calculated using the &#039;&#039;velocity-Verlet algorithm&#039;&#039;, mentioned previously. &lt;br /&gt;
&lt;br /&gt;
The classical solution was calculated using:&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.00&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variation in absolute error between the two methods was calculated for the same timesteps as used to optimise the energy calculations. This error follows an envelope function, plotted linearly in &#039;&#039;&#039;Graps X and Y&#039;&#039;&#039; for timesteps of &amp;lt;math&amp;gt;0.1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:3 errors.png|500px|center|The Envelope Function showing the Error Maxima at timesteps 0.1 and  0.2 L-R]]&lt;br /&gt;
&lt;br /&gt;
The variation in &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta E&amp;lt;/math&amp;gt; (both range and absolute) with timestep is summarised in &#039;&#039;&#039;Table x&#039;&#039;&#039;, along with the number of error peaks. There is seen to be increasing error with deviation away from a suitable timestep (of &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt;). This is rationalised in that more timesteps samples a longer period of time and hence there are more maxima on the error graphs. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!x &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!x &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;&lt;br /&gt;
!E &amp;lt;sub&amp;gt;min&amp;lt;/sub&amp;gt;&lt;br /&gt;
!ΔE&lt;br /&gt;
!Number of Error Peaks&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5  &lt;br /&gt;
|0.49875&lt;br /&gt;
|0.00125&lt;br /&gt;
|5&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49500&lt;br /&gt;
|0.00500&lt;br /&gt;
|9&lt;br /&gt;
|-&lt;br /&gt;
|0.21&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49449&lt;br /&gt;
|0.00551&lt;br /&gt;
|10&lt;br /&gt;
|-&lt;br /&gt;
|0.205&lt;br /&gt;
|1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|0.5&lt;br /&gt;
|0.49474&lt;br /&gt;
|0.00525&lt;br /&gt;
|9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
REF &lt;br /&gt;
&lt;br /&gt;
LeSar, R. (n.d.). Introduction to computational materials science.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is used to model the interactions between pairs of atoms in our system. This simplifies the system to ignore Coulombic effects and simulates the potential energies of two uncharged molecules according to the curve shown in &#039;&#039;&#039;image X &#039;&#039;&#039;, which has contributions from both positive attractions (due to the &#039;&#039;induced dipole moments&#039;&#039; of atoms moving in a liquid) and negative interactions (&#039;&#039;short-range repulsion&#039;&#039; between atoms).&lt;br /&gt;
&lt;br /&gt;
[[image:Lennard Jones V vs r.png|right|400px|&#039;&#039;&#039;Image X&#039;&#039;&#039; - Potential Energy as a Function of r, Lennard Jones curve, Ref  https://en.wikipedia.org/wiki/Melting-point_depression#/media/File:Lennard-Jones.jpg]]&lt;br /&gt;
&lt;br /&gt;
This is illustrated in the formula &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 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;
&lt;br /&gt;
If the separation is small, the potential is dominated by the &lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{ij}^{12}}&amp;lt;/math&amp;gt; term - i.e. strongly positive, with much short-range repulsion. &lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r \mapsto \infty &amp;lt;/math&amp;gt;, the &amp;lt;math&amp;gt;\frac{\sigma^6}{r_{ij}^6}&amp;lt;/math&amp;gt; term dominates, hence long range attraction occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
ANSWER: &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt; at which potential energy, &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt;, equals 0:&lt;br /&gt;
&lt;br /&gt;
It is clear that &amp;lt;math&amp;gt; U &amp;lt;/math&amp;gt; will become zero when &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; since this causes the term &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} &amp;lt;/math&amp;gt; to equal 0.&lt;br /&gt;
&lt;br /&gt;
As stated above, &amp;lt;math&amp;gt; r^{12} &amp;lt;/math&amp;gt; is long range repulsion; &amp;lt;math&amp;gt; r^{6} &amp;lt;/math&amp;gt; is long range attraction&lt;br /&gt;
&lt;br /&gt;
* hence if &amp;lt;math&amp;gt; r_0 = \sigma &amp;lt;/math&amp;gt; the force at this separation is calculated using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}_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;\mathbf{F}_0 = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* and since &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at &amp;lt;math&amp;gt; U = 0 &amp;lt;/math&amp;gt; is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = 0 - \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = 4\epsilon \frac{12\sigma^{12}}{r_0^{13}} - \frac{6\sigma^6}{r_0^6} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Giving &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the separation at equilibrium &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; has a force equal to zero:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r_{eq}}} = 0 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 2\sigma^6 = r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sigma 2^{\frac{1}{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r) = 4 \epsilon (\frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2\sigma^6}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = 4 \epsilon(\frac{1}{4} - \frac{1}{2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = - \epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals given may then be evaluated by setting &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.025 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.008 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.003&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm  all we must define is the initial starting positions and velocities.&lt;br /&gt;
&lt;br /&gt;
These simulations are performed for &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; between &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; since it is too expensive to simulate realistic volumes.&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1ml of water under standard conditions may be estimated as follows: &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REF Standard conditions: (refer to IUPAC IUPAC. Compendium of Chemical Terminology, 2nd ed. (the &amp;quot;Gold Book&amp;quot;). Compiled by A. D. McNaught and A. Wilkinson. Blackwell Scientific Publications, Oxford (1997). XML on-line corrected version: http://goldbook.iupac.org (2006-) created by M. Nic, J. Jirat, B. Kosata; updates compiled by A. Jenkins. ISBN 0-9678550-9-8. doi:10.1351/goldbook.  )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; pressure = P = 10^5 Pa &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; temperature = T = 273.15 K &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; concentration = c^{\omicron} = 1 mol  dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1ml H_2O = 1 dm^{3} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;density \, of \, H_2O = \rho = 999.8395 kg \, m^{-3} = 0.998395 g \, dm^{-3} &amp;lt;/math&amp;gt; under standard conditions&lt;br /&gt;
&lt;br /&gt;
therefore mass of &amp;lt;math&amp;gt; 1 dm^3 = 0.998395 g dm^{-3} \times 1 dm^{3} = 0.998395 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
since &amp;lt;math&amp;gt; mass(H_2O)= 18.015 g mol^{-1} &amp;lt;/math&amp;gt;, number of molecules of &amp;lt;math&amp;gt; H_2O = \frac{0.998395 g}{18.015 g mol^{-1}} \times N_A = 3.35 \times 10^{22} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions:&lt;br /&gt;
&lt;br /&gt;
the volume of one molecule may be deduced from the first calculation above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{total \, volume}{number \, of \, molecules} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; volume (one \, molecule) = \frac{volume (3.35 \times 10^{22} mol)}{3.35 \times 10^{22} mol} = \frac{1 dm^{3}}{3.35 \times 10^{22} mol} = 2.99 \times 10^{-23} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and so the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; molecules is simply:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 10000 \times 2.99 \times 10^{-23} dm^{-3} = 2.99 \times 10^{-19} dm^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We utilise a periodic box (similar to a unit cell) to generate a system of large volume. If an atom leaves at one position, its replica will enter from the opposite direction. &lt;br /&gt;
&lt;br /&gt;
Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. It therefore ends up at the point &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because..:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.7 = 1.2 &amp;lt;/math&amp;gt; which becomes &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; in this system of volume &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.1 = 0.6 &amp;lt;/math&amp;gt;  o.k. / within cube boundaries&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0.5 + 0.2 = 0.7 &amp;lt;/math&amp;gt;  fine also within the boundaries&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
We simplify the calculations performed in the Lennard-Jones simulation by using reduced units, denoted by a star&lt;br /&gt;
&lt;br /&gt;
e.g. distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes &amp;lt;math&amp;gt;r*&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* LJ cutoff:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = 3.2 = \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r = r^* \sigma = 3.2 \times 0.34 nm = 1.088nm &amp;lt;/math&amp;gt; ~ &amp;lt;math&amp;gt; 1.09nm = 1.09 \times 10^{-9} m &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120 k_B = 120 K \times 1.3806 \times 10^{-23} J K^-1 = 1.657 \times 10^{-21} J &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore per molecule the well depth is: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.657 \times 10^{-21} J / N_A = 1.66 \times 10^{-21} J /6.0221 \times 10^{23} kJ mol^{-1} = 1.66 \times 10^{-24} \times 6.0221 \times 10^{23} kJ mol^-1 = 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the reduced temperature:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon} =\frac{k_BT}{k_B \times 120K} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; ,this rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{1.5 \times k_B \times 120K}{k_B} = 1.5 \times 120K = 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration == &lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
Using the velocity-Verlet algorithm required the initial starting conditions to be set. This is fairly straightforward for a crystal in which the lattice parameters are known, but for a liquid without fixed bonds it requires a different approach.&lt;br /&gt;
&lt;br /&gt;
If the positions of atoms were simply picked at random, a physically impossible system may be generated, in which atoms co-exist in the same region of space. Clearly it is impossible for two (or more) atoms to overlap with one another - the fact they are physical objects makes this so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is illustrated by the Lennard-Jones curve where &amp;lt;math&amp;gt;E_{pot} \mapsto \infty &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r \mapsto 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the LAMPPS is output as &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;
This gives a number density &amp;lt;math&amp;gt; = 0.8&amp;lt;/math&amp;gt; shown by the following calculations:&lt;br /&gt;
&lt;br /&gt;
(Knowing that for a cubic lattice we have one lattice point per unit cell)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;number \, density (\rho) = \frac{number \, of \, lattice \, points}{volume \, of \, 3D \, lattice}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
lattice spacing &amp;lt;math&amp;gt;d = 1.07722&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;d^3 = 1.07722^3 = 1.250009243 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = 1 / d^3 = 0.799999 \approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice with a lattice point number density of 1.2 has a unit cell side length of &amp;lt;math&amp;gt; \approx 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is calculated as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^{\frac{1}{3}} = 3.3333333^{\frac{1}{3}}= 1.493801582 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;pre&amp;gt;create_atoms&amp;lt;/pre&amp;gt; command defines the number of atoms created for a lattice. &lt;br /&gt;
&lt;br /&gt;
For a simple cubic cell there is 1 lattice point per unit cell, whilst a face centred cubic cell has 4 lattice points per unit cell. &lt;br /&gt;
&lt;br /&gt;
Therefore 1000 unit cells will have 1000 atoms for a sc system but 4000 atoms for an fcc system.&lt;br /&gt;
&lt;br /&gt;
===LAMMPS and syntax===&lt;br /&gt;
&lt;br /&gt;
The input script contains the following commands:&lt;br /&gt;
&lt;br /&gt;
*mass 1 1.0&lt;br /&gt;
*pair_style lj/cut 3.0&lt;br /&gt;
*pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the mass of atom 1 (for a given atom of pure fluid) set to equal a value of 1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets the cutoff point (at which we no longer have atoms pairing with each other) to the Lennard-Jones (lj) potential, and since atoms are not bonded to each other in this system, this also defines which neighbouring atoms are &amp;amp; aren&#039;t interacting. Hence nearest neighbours and pairing potentials vary over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This defines the pairwise force field coefficients; the leading asterisk and trailing asterisk combine to give all atom types from 1 to n and n to N which in this instance is simply 1 (as there is only 1 type of atom). Hence also the atom coefficients in a pair are both set to 1.0 since the atoms are of the same type and so have equal contributions to a pairwise force field. The final term sets the coefficients for all atom pairs to equal 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation now has 1000 atoms, with the starting position &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, masses and interatomic forces defined for each of them. &lt;br /&gt;
The final thing we need to define to completely specify the initial conditions is the velocity of each atom. The velocities of atoms in any system are defined by the Maxwell-Boltzmann distribution - this is easily achieved for &amp;lt;pre&amp;gt;all&amp;lt;/pre&amp;gt; atoms at a reduced temperature of &amp;lt;pre&amp;gt;1.5&amp;lt;/pre&amp;gt; using LAMPSS with the script&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;
&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;xi (0)&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;vi (0)&amp;lt;/math&amp;gt; , we use the velocity-Verlet algorithm in our simulations.&lt;br /&gt;
&lt;br /&gt;
=====Specifying the timestep=====&lt;br /&gt;
&lt;br /&gt;
The script includes the lines&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001 &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is written in this way since we want to use different values of timesteps (0.001, 0.0025, 0.0075, 0.01 and 0.015) to calculate the same measurements. If we simply used &lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
 run 100000&amp;lt;/pre&amp;gt; &lt;br /&gt;
it would not be possible to simply alter the code in future calculations with a different timestep (variable). &lt;br /&gt;
&lt;br /&gt;
Moreover if we want to calculate the same overall time for different numbers of steps the floor function enables this. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Liq Sim VMD progress.png|center|Some screengrabs showing VMD simulation progress for 2 molecules singled out of the system]]&lt;br /&gt;
&lt;br /&gt;
one of the spheres seems to change position across the box very rapidly —&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;this occurs when it reaches one periodic boundary, and is reflected &lt;br /&gt;
back across the other face&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
Simulations were visualised using [http://www.ks.uiuc.edu/Research/vmd/ VMD software] to determine whether equilibrium was reached - and whether it was reached to a suitable degree of accuracy. This allows the determination of a suitable timestep for calculations that will be performed later on.&lt;br /&gt;
&lt;br /&gt;
The simulation reached equilibrium for the four smallest timesteps, as visible by the plateaus in &#039;&#039;&#039;Graph X&#039;&#039;&#039;. However the largest timestep of 0.015 failed to bring the system to equilibrium and therefore definitely should not be used. &lt;br /&gt;
&lt;br /&gt;
[[image:3 Energy all Diff Ts.png|center|&#039;&#039;&#039;Graph X&#039;&#039;&#039;|Energy versus Time for all the timesteps]]&lt;br /&gt;
Thus timesteps 0.001, 0.0025, 0.0075 and 0.01 give reasonable results as they all reach equilibrium. However it is clear that the measurements are less accurate above the timestep of 0.0025, since the energy oscillates at a higher energy. The timestep of 0.0075, has a 0.06% error in energy with respect to the energy calculated at a timestep of 0.001 (the smallest and therefore most accurate system), which increases to 0.1% for ts = 0.01. In terms of cost, 0.0025 requires 40000 steps whilst 0.0075 requires 1334 steps. There is not a huge computational cost to improving the accuracy - thus the timestep of 0.0025 (with % error for energy = 0.005) is the best compromise between accuracy and cost.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To determine how long the system took to reach equilibrium, the plots of Energy versus Time for a timestep of 0.001 were zoomed in. It is apparent that equilibrium is reached at a time of roughly 0.5.&lt;br /&gt;
&lt;br /&gt;
[[image:3 equilibration.png|center|Zooming into the graph to see at what point the system reaches equilibrium]]&lt;br /&gt;
&lt;br /&gt;
It is also apparent that equilibrium conditions were reached by inspection of the Pressure-Time and Temperature-Time plots, seen in the &#039;&#039;&#039;Graphs &#039;&#039;&#039;. The results for the other timesteps were consistent with these, and validates the choice of 0.0025 for further calculations.&lt;br /&gt;
[[image:3 pressure t 0.001.png|150px|thumb|left|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Pressure versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
[[image:3 Temp t 0.001.png|150px|thumb|right|&#039;&#039;&#039;Graph &#039;&#039;&#039; - Temperature versus Time for the 0.001 Timestep]]&lt;br /&gt;
&lt;br /&gt;
==Part 4 Running Simulations under Specific Conditions==&lt;br /&gt;
The simulations thus far were performed using the microcanonical (NVE) ensemble, and seen to give a constant average value for timesteps of less than 0.01. &lt;br /&gt;
&lt;br /&gt;
However to investigate thermodynamic properties under specific conditions, the isobaric-isothermal ensemble (NpT) must be employed instead. This ensemble keeps the &#039;&#039;temperature&#039;&#039; and &#039;&#039;pressure&#039;&#039; constant, and again uses a defined timestep to model the simulation. The optimal timestep has already been chosen as 0.0025.&lt;br /&gt;
&lt;br /&gt;
Ten simulations were run with the following parameters &#039;&#039;&#039;SHOWN IN TABLE &#039;X&#039;&#039;&#039;&#039; (in reduced units):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.5&lt;br /&gt;
|1.95&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.55&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.65&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.75&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.85&lt;br /&gt;
|-&lt;br /&gt;
|2.7&lt;br /&gt;
|1.95&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressures were chosen to be close to the average pressure of 2.62 from the equilibrium simulations. This should give a physically reasonable system. From these ten simulations, ten phase points are generated from which an &#039;&#039;Equation of State &#039;&#039;may be derived.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;equipartition theorem&#039;&#039; states that, on average, every degree of freedom in a system at equilibrium will have &amp;lt;math&amp;gt;\frac{1}{2}k_B T&amp;lt;/math&amp;gt; of energy. In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom, we can write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
At the end of every timestep, we use the left hand side of this equation to calculate the kinetic energy, then divide by &amp;lt;math&amp;gt;\frac{3}{2}Nk_B&amp;lt;/math&amp;gt; to get the &#039;&#039;instantaneous&#039;&#039; temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;. In general, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will fluctuate, and will be different to our &#039;&#039;target&#039;&#039; temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. We can change the temperature by multiplying every velocity by a constant factor, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too high, and we need to reduce it. &amp;lt;math&amp;gt;\gamma &amp;lt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
* If &amp;lt;math&amp;gt; T &amp;lt; \mathfrak{T} &amp;lt;/math&amp;gt;, then the kinetic energy of the system is too low, and we need to increase it. &amp;lt;math&amp;gt;\gamma &amp;gt; 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&lt;br /&gt;
&lt;br /&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;&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;&lt;br /&gt;
&lt;br /&gt;
These may be solved to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; T = \mathfrak{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we expand &amp;lt;math&amp;gt;(\gamma v_i)^2&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\gamma^2 v_i^2&amp;lt;/math&amp;gt;, the fraction becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sum_i m_i v_i^2}{\sum_i m_i \left(\gamma^2 v_i^2\right)} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (1)^\frac{1}{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or substituting back in the relationship &amp;lt;math&amp;gt; \frac{T}{\mathfrak{T}} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the factor is equal to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{T}{\mathfrak{T}})^\frac{1}{2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
The temperature and pressure are controlled by the line:&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This translates to:&lt;br /&gt;
&lt;br /&gt;
*fix = operation&lt;br /&gt;
*aves all = group of atoms this operation is being applied to (all atoms here)&lt;br /&gt;
*ave/time = style name of this command&lt;br /&gt;
*100 = use input values every this many timesteps (every 100 timesteps)&lt;br /&gt;
*1000 = number of times to use input values for calculating averages (1000 since 1000 atoms)&lt;br /&gt;
*100000 = calculate averages every this many timesteps (just once in this simulation then since overall sim is 100000 timesteps)&lt;br /&gt;
&lt;br /&gt;
Hence the average is calculated for the whole system, with the parameters being sampled every 100 timesteps (which equals 100000/100 = 1000 times) and (100000/1000=)100 measurements contributing to the average. The amount of time simulated is (100000*0.0025 =) 250 (in reduced units).&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
[[image:Pt4 aile.png|center|Density versus Temperature at both pressures]]&lt;br /&gt;
&lt;br /&gt;
The density (&amp;lt;math&amp;gt;\frac{N}{V}&amp;lt;/math&amp;gt;) at each pressure was plotted as a function of temperature, and is visible via a blue line in &#039;&#039;&#039;Graphs X and X&#039;&#039;&#039;. The error bars shown correspond to the standard error associated with each phase point, as detailed in the output log file. The vertical error bars are too small to be seen on the graphs since the error in density was in the order of &amp;lt;math&amp;gt; 3 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density may be calculated from the ideal gas law using &lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P V = n R T  = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
with the number of moles of gas &amp;lt;math&amp;gt; n = \frac{N}{N_A} &amp;lt;/math&amp;gt; and the gas constant &amp;lt;math&amp;gt; R = N_A k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{N}{V} = \frac{P}{k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, &amp;lt;math&amp;gt; k_B  = 0 &amp;lt;/math&amp;gt; and hence the density is easily calculated from the pressure and temperatures as shown by the orange line in the Density-Pressure &#039;&#039;&#039;graphs x and y &#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law predicts a higher density than that simulated. This was anticipated because the ideal gas law &#039;&#039;&#039;holds assumptions&#039;&#039;&#039; that neglect atom size and interatomic attractions, thus placing atoms at distances further apart than they are in reality. &lt;br /&gt;
&lt;br /&gt;
However, at higher pressure, the average distance between atoms is less significant with respect to molecular size and so the neglection of atom size becomes less important, and the ideal gas model becomes more accurate. Similarly, at higher temperatures the neglection of interatomic attractions is less important (since they are reduced) and again, the two models are closer in value.&lt;br /&gt;
&lt;br /&gt;
As the temperature increases, the atoms gain more energy and thus are separated by a greater distance (increased repulsion) and thus the ideal gas model neglection of this distance becomes less important.&lt;br /&gt;
&lt;br /&gt;
Hence the discrepancies between the ideal gas density and the simulated density decrease with both temperature and pressure. Mathematically, the average difference at &amp;lt;math&amp;gt; P = 2.5 &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 0.746 &amp;lt;/math&amp;gt;, which reduces to &amp;lt;math&amp;gt; 0.186 &amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt; P = 2.7 &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Assumptions&lt;br /&gt;
*(1) N is very large (there is a large number of atoms), which obey Newton&#039;s laws of motion&lt;br /&gt;
*(2) the atomic volume is far smaller than the volume of the gas (negligible)&lt;br /&gt;
*(3) there are no forces (electrostatic or otherwise) acting on the atoms except extremely brief collisions (which are ignored)&lt;br /&gt;
&lt;br /&gt;
==Part 5 Heat Capacities of the System==&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; of a system is defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\delta Q}{\delta T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our system, the temperature is being held constant and thus we use fluctuations in the total energy to determine the capacity instead. The eqaution for this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; since we have calculated the energies in LAMMPS using the input script&lt;br /&gt;
&amp;lt;pre&amp;gt; pair_style lj &amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
which normalises the energy by the number of atoms (i.e. the output &amp;lt;math&amp;gt; E &amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; \frac{E}{N}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A script was written based on the file npt.in provided for the isobaric-isothermal ensemble. &lt;br /&gt;
The differences made were:&lt;br /&gt;
&lt;br /&gt;
* to allow the density of the system to be varied according to the &lt;br /&gt;
&amp;lt;pre&amp;gt; sc &amp;lt;/pre&amp;gt; lattice command syntax&lt;br /&gt;
&lt;br /&gt;
* to change the NpT ensemble to NvT &lt;br /&gt;
*turn off the thermostat once the system has reached equilibrium (the crystal has melted)&lt;br /&gt;
&lt;br /&gt;
*add variables to allow the calculation of the heat capacity, according to the equation above&lt;br /&gt;
&lt;br /&gt;
*print the average temperature and heat capacity&lt;br /&gt;
&lt;br /&gt;
plot &amp;lt;math&amp;gt; C_V / V &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; V = [lattice \, parameter]^3 = 1.07722^3 = 1.25001 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The plots are shown below&lt;br /&gt;
&lt;br /&gt;
[[image:Cv V-Vs T.png|center]]&lt;br /&gt;
&lt;br /&gt;
An example of the script used for &amp;lt;math&amp;gt; p = 0.2, t = 2.0 &amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc 0.2&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0 &lt;br /&gt;
variable p equal 2.5 &lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable esquared equal etotal*etotal&lt;br /&gt;
variable e equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_esquared v_e &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable heatcp equal atoms*atoms*(f_aves[7]-f_aves[8]*f_aves[8])/f_aves[2]*f_aves[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcp}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the radial distribution function (RDS)==&lt;br /&gt;
&lt;br /&gt;
The radial distribution function generates a plot of the number of nearest neighbours at increasing interatomic distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.  This can be used to infer structural properties of the systems.&lt;br /&gt;
&lt;br /&gt;
[An average is taken in canonical ensemble NVT, integrate&lt;br /&gt;
Thermdyn properties can be calculated (https://en.wikipedia.org/wiki/Radial_distribution_function)]&lt;br /&gt;
&lt;br /&gt;
http://www.lehigh.edu/imi/teched/AtModel/Lecture_5_Micoulaut_Atomistics_Glass_Course.pdf&lt;br /&gt;
&lt;br /&gt;
RDFs were generated for a vapour, liquid and solid defined by the following parameters (ascertained from analysing a [http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151 Lennard-Jones phase diagram]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vapour&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.05&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 0.75&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 0.8&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Reduced density = 1.2&lt;br /&gt;
&lt;br /&gt;
Reduced temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
reference for this part: Jean-Pierre Hansen and Loup Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039; &#039;&#039;&#039;184&#039;&#039;&#039;, 151 – Published  5 August 1969&lt;br /&gt;
P. Ossi, Disordered Materials: An Introduction, Springer, Milan, 2003&lt;br /&gt;
[[image:RDFs A;;.png|600px|All Calculated RDFs - g(r) vs. r]]&lt;br /&gt;
&lt;br /&gt;
Unsurprisingly, the RDF is 0 for &amp;lt;math&amp;gt; r \leq ~ 0.9 &amp;lt;/math&amp;gt;. The Lennard-Jones repulsion term prevents the coexistense of atoms in this region below atomic diameter since such an overlap is physically impossible without great perturbation of the atomic structures (see [[#Atomic Forces|Atomic Forces]]).&lt;br /&gt;
&lt;br /&gt;
For the vapour phase, there is only one clear peak, with a possible secondary peak on its shoulder. This contrasts with the increasing number of peaks in the liquid and solid phases, as the system becomes more ordered and each particle experiences interactions with more neighbours at closer distances.   &lt;br /&gt;
&lt;br /&gt;
The liquid has a fairly smooth transition from&lt;br /&gt;
* peak one at (&amp;lt;math&amp;gt; r \approx 1 &amp;lt;/math&amp;gt;): a situation analagous to a solvation shell, with the First Nearest Neighbours included; &amp;lt;math&amp;gt; g(r) \approx 3.5 &amp;lt;/math&amp;gt;&lt;br /&gt;
* peak two  at (&amp;lt;math&amp;gt; r \approx 2 &amp;lt;/math&amp;gt;): there are fewer Second Nearest Neighbours than First, in a similar way to how a primary solvation shell solvates tightly around a central ion, thus limiting the size of the outer hydration shell. Also for this peak, &amp;lt;math&amp;gt; g(r) \approx 1.25 &amp;lt;/math&amp;gt;, implying that molecules are half as likely to be found at this separation than at the separation defined by the first peak (since the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; is half the size)&lt;br /&gt;
* peak three at (&amp;lt;math&amp;gt; r \approx 3 &amp;lt;/math&amp;gt;): the next nearest neighbours are suficiently far away to be tending towards bulk solution, with minimal attractive interaction&lt;br /&gt;
&lt;br /&gt;
The first, second and subsequent troughs are the repulsions experienced between the central atom and opposing atoms and minimalise as the distance increases.&lt;br /&gt;
&lt;br /&gt;
[[image:RDF integral.png]]&lt;br /&gt;
&lt;br /&gt;
[[image:RDF solid.png]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the RDF of the solid are seen to be more defined than for the liquid and vapour phases in which the atoms are not fixed in place and are more free to move. The atoms in a solid are fixed in position at given lattice points - and thus experience consistent interactions with neighbouring atoms. &lt;br /&gt;
&lt;br /&gt;
Additionally, the amplitude of the peaks endure at higher levels and higher &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values in the RDF for the solid phase, implying that long range order permeates to longer distances in a solid than in the other phases. This is reasonable when the structure of a solid is considered relative to the disorder of gases and liquids.&lt;br /&gt;
&lt;br /&gt;
Moreover, the lattice spacing may be deduced from the RDF of the solid by correlating the peak to points on the lattice. The first peak corresponds to the nearest neighbours to a given atom (of which  there are 12 for an fcc lattice). The second peak corresponds to the lattice spacing which is therefore equivalent to &amp;lt;math&amp;gt; d \approx 1.49 &amp;lt;/math&amp;gt; for this solid. The third peak, with &amp;lt;math&amp;gt; g(r_3) \approx \frac{1}{2} g(r_1) &amp;lt;/math&amp;gt;  (i.e. g(r) = 2.4 at r = 1.825, which is roughly half of g(r) (=4.6) at 1.025, corresponds to the third nearest neighbour shell. The coordination numbers are 12 for the first shell, 6 for the second nearest shell and 24 for the third nearest shell.&lt;br /&gt;
&lt;br /&gt;
Coordination number at distance &amp;lt;math&amp;gt; r_A = 4 \pi   g(r) r^2 dr &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Part 7==&lt;br /&gt;
Mean squared displacement calculations: how much are the atoms moving around? how static is the system? (solid &amp;gt; liq &amp;gt; vap ..?)&lt;br /&gt;
&lt;br /&gt;
liq.in values..:&lt;br /&gt;
&lt;br /&gt;
Vapour:&lt;br /&gt;
&lt;br /&gt;
Red density = 0.05&lt;br /&gt;
&lt;br /&gt;
T = 0.75&lt;br /&gt;
&lt;br /&gt;
Liquid:&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
Red density = 0.8&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
&lt;br /&gt;
Red density = 1.2&lt;br /&gt;
&lt;br /&gt;
Red T = 1.2&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; &lt;br /&gt;
that will run a simulation at specified density and temperature to &lt;br /&gt;
calculate the mean squared displacement and velocity autocorrelation &lt;br /&gt;
function of your system. Run one of these simulations for a vapour, &lt;br /&gt;
liquid, and solid. You have also been given some simulated data from &lt;br /&gt;
much larger systems (approximately one million atoms). You will need &lt;br /&gt;
these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your &lt;br /&gt;
simulations (solid, liquid, and gas), showing the mean squared &lt;br /&gt;
displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as &lt;br /&gt;
you would expect? Estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. Be careful with the units! Repeat this procedure for the &lt;br /&gt;
MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the &lt;br /&gt;
equation for the evolution of the position of a 1D harmonic oscillator &lt;br /&gt;
as a function of time was given. Using this, evaluate the normalised &lt;br /&gt;
velocity autocorrelation function for a 1D harmonic oscillator (it is &lt;br /&gt;
analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using the formula &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And thus is simply &amp;lt;math&amp;gt;\frac{gradient \, of \, the \, MSD \, curves}{6}&amp;lt;/math&amp;gt; &lt;br /&gt;
However, we must convert the value of the gradient from timesteps into time using the reduced units. Since the value of the timesteps was 0.002, the measured gradient is simply divided by 0.002 to give the diffusion coefficient in correct units.&lt;br /&gt;
&lt;br /&gt;
Solid:&lt;br /&gt;
Liquid: &lt;br /&gt;
Gas:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!State&lt;br /&gt;
!Data&lt;br /&gt;
!Gradient&lt;br /&gt;
!D&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Simulated&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|Provided&lt;br /&gt;
|5 x 10&amp;lt;sup&amp;gt;-8&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.17 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|Provided&lt;br /&gt;
|0.001&lt;br /&gt;
|8.3 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Simulated&lt;br /&gt;
|0.0167&lt;br /&gt;
|1.39&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|Provided&lt;br /&gt;
|0.0305&lt;br /&gt;
|2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;change vapour on graph to gas*?&lt;br /&gt;
===Evaluation of the normalised velocity autocorrelation function for a 1D harmonic oscillator: ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is given by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Considering that the velocity is defined by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\mathrm{d}x}{\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can apply the chain rule to define &amp;lt;math&amp;gt; v\left(t\right) &amp;lt;/math&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
set &amp;lt;math&amp;gt; u &amp;lt;/math&amp;gt;to equal &amp;lt;math&amp;gt; (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}u}{\mathrm{d}t} = \omega &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
hence&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \frac{\mathrm{d}}{\mathrm{d}t} A\cos\left(\omega t + \phi\right) = A\cos\left(u\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = \frac{\mathrm{d}}{\mathrm{d}u} A\cos\left(u\right) \frac{\mathrm{d}u}{\mathrm{d}t} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\sin\left(u\right) \omega &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = v &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the velocity at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; relative to time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; we adapt the equation for &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v\left(t + \tau\right) = \frac{\mathrm{d}x}{\mathrm{d}(t + \tau)}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega (t + \tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; = -A\omega\sin\left(\omega t + \omega\tau) + \phi\right) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
this may then be substituted into the autocorrelation function to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -A\omega\sin\left(\omega t + \phi\right) -A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} -A^2\omega^2\sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} A\omega\sin\left(\omega t + \phi\right) A\omega\sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \omega\tau) + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may then be expanded using the trigonomic identity &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(x + y\right) = \sin\left(x\right) \cos\left(y\right) + \cos\left(x\right) \sin\left(y\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to give:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) [\sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \cos\left(\omega\tau\right) \sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \sin\left(\omega\tau\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) \cos\left(\omega\tau\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \frac{\cos\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)  \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} + \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thence, the first term &amp;lt;math&amp;gt; = \frac{\sin\left(\omega\tau\right)\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \cos\left(\omega t + \phi\right) + \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
simplifies to zero using the identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} \sin\left(x\right) \cos\left(x\right) \mathrm{d}t = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C\left(\tau\right) = \cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;and the VACFs from your liquid and solid simulations. What do the &lt;br /&gt;
minima in the VACFs for the liquid and solid system represent? Discuss &lt;br /&gt;
the origin of the differences between the liquid and solid VACFs. The &lt;br /&gt;
harmonic oscillator VACF is very different to the Lennard Jones solid &lt;br /&gt;
and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
ANSWER:&lt;br /&gt;
Minima when particles no interacting (r --&amp;gt; infinity)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the &lt;br /&gt;
integral under the velocity autocorrelation function for the solid, &lt;br /&gt;
liquid, and gas, and use these values to estimate &lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;in each case. You should make a plot of the running integral in each &lt;br /&gt;
case. Are they as you expect? Repeat this procedure for the VACF data &lt;br /&gt;
that you were given from the one million atom simulations. What do you &lt;br /&gt;
think is the largest source of error in your estimates of D from the &lt;br /&gt;
VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image: AilC MSD Liquid.png]]&lt;br /&gt;
[[image:AilMSD Calc Solid.png]]&lt;br /&gt;
[[image:AilC MSD Vapour.png]]&lt;br /&gt;
[[image:Ail Vapour MSD Provided.png]]&lt;br /&gt;
[[image:Ail Solid MSD Provided.png]]&lt;br /&gt;
[[image:Ail Liquid MSD Provided.png]]&lt;/div&gt;</summary>
		<author><name>Ac2613</name></author>
	</entry>
</feed>