<?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=Jwc13</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=Jwc13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Jwc13"/>
	<updated>2026-05-16T13:42:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:FRMD&amp;diff=612377</id>
		<title>Talk:Mod:FRMD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:FRMD&amp;diff=612377"/>
		<updated>2017-04-02T23:21:52Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks completed and results well presented.  Some of the written explanations were a bit confusing though, make sure that you understand the background theory behind each task so that you can fully explain what your results show and what they mean physically.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Molecular dynamics can be used in many situations where a real life experiment may not be feasible. Being able to run highly sophisticated computer simulations can provide an insight into a wide range of real life systems, and to remarkable accuracy. It can be used to calculate the position, velocity and appropriate force of an atom to measure thermodynamic properties such as a system&#039;s energy, volume, heat capacity and temperature, all from the comfort of a desk, and without the need to ever wear a lab coat. The core principle behind it is the solving of Newton&#039;s equations of motion for a system of interacting particles, at a snapshot in time. These are dependent on a previous conditions, and these snapshots are built up to form an overall picture. Statistical physics enables us to take all the individual properties and combine them, to form a replica of a real life system.&lt;br /&gt;
&lt;br /&gt;
For this experiment, the Large-scale Atomic/Molecular Massively Parallel Simulator, or LAMMPS software was used. After optimising the accuracy of the simulation, density, heat capacity and diffusion coefficient were investigate, for solid, liquid and vapour states.&lt;br /&gt;
&lt;br /&gt;
====Introduction to molecular dynamics simulation====&lt;br /&gt;
The velocity verlet algorithm considers the acceleration of an atom to be dependent on its position, and was used to calculate the velocities and positions at snapshots in time. &lt;br /&gt;
&lt;br /&gt;
Initially, we used this algorithm to model a simple harmonic oscillator. To assess it&#039;s accuracy, a classical simple harmonic oscillator was also modelled, and the position of an atom from this model is shown in equation 1. For our calculations, &amp;lt;math&amp;gt; \phi = 0 \ \   A = 1.00 \ \  \omega = 1.00 &amp;lt;/math&amp;gt;. The total energy was calculated from the sum of the kinetic and potential energy, shown in equation 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; x(t) = A \cos(\omega t + \phi) \ \ (1) &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; E = K + U = \frac{1}{2}mv^2+\frac{1}{2}kx^2 \ \ (2) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a timestep of 0.1s, the two models are shown in figure 1. The error between the two models is shown in figure 2, and the maxima can be connected using a linear fit, &lt;br /&gt;
of equation &amp;lt;math&amp;gt;4.21552195\times10^{-4}x-7.3021874\times10^{-5}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| [[File:FR Displacement vs t.png|500x500px|thumb|center|Figure 1. Displacement vs time using the velocity-varlet algorithm]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| [[File:FR Max error vs t.png|500x500px|thumb|center|Figure 2. The absolute error between the classical solution and the velocity-varlet solution]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation occurs over the course of 100s, meaning the error is much larger towards the end of the simulation, due to the error being a function of time. Figure 3 shows the maximum errors associated with several time steps, and shows a dramatic enhancement in the accuracy of the model by reducing the time step by a factor of 10. This results in a reduction in absolute error by a factor of 100.&lt;br /&gt;
 &lt;br /&gt;
[[File:FR Max error several time stepsvs t.png|500x500px|thumb|center|Figure 3. Absolute error for several time steps]]&lt;br /&gt;
&lt;br /&gt;
The total energy of the system also oscillates slightly, as shown in figure 4. As the system is meant to be isolated, the total energy should remain constant and so it is important to monitor the total energy to ensure the model is representative of the real life situation it is trying to replicate. These oscillations can be reduced by reducing the time between the measured snapshots, as the velocity verlet algorithm endures an error in the calculation of the position and velocity. This is due to both calculations involving the multiplication of a previously calculated value by the &amp;lt;math&amp;gt; \delta t&amp;lt;/math&amp;gt;. The error for the algorithm for position can be derived to be &amp;lt;math&amp;gt;O(\Delta t^4)&amp;lt;/math&amp;gt; and for velocity is &amp;lt;math&amp;gt;O( \Delta t^2)&amp;lt;/math&amp;gt;&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;. More importantly for large scale molecular dynamics, the global error for both is &amp;lt;math&amp;gt;O(\Delta t^2)&amp;lt;/math&amp;gt;. The percentage error in calculating the total energy is therefore shown in Table 1. In order to achieve a total energy change of under 1%, a timestep of under 0.2s should be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:FR Energy 0.1.png|500x500px|thumb|center|Figure 4. Total energy vs time for a time step of 0.1s ]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Table 1. Energy percentage error for different time steps.&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot; | &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;text-align: center;&amp;quot; | Energy&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;text-align: center;&amp;quot; | Lowest Value&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | Highest Value&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | % error&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.50s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.468750&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 6.6667&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.25s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.492188&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 1.5873&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.20s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.495000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 1.0101&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.10s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.498750&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.2506&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.01s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.499988&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.0025&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We are choosing to model the system using the Lennard-Jones interaction, which is described in Equation 3. This keeps us within the realms of classical mechanics, and avoids the need to delve into quantum physics.&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\} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For a single interaction, this can be simplified.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi (r)=4\epsilon( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}) \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction, the separation,&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is 0 is calculated below. &lt;br /&gt;
&amp;lt;center&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0=4\epsilon \big( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\big)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\ \frac{\sigma^{12}}{r_0^{12}}=\frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6}=r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;or&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=-\sigma &amp;lt;/math&amp;gt; (&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is positive, therefore &amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force acting on an object at a given potential is shown in equation 5.&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F_i=-\frac{d \phi (r^N)}{dr_i} \ \ (5)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the force at &amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=\frac{\phi (r)}{dr} = -4 \epsilon \big( -12 \frac {\sigma ^{12}}{r_0^{13}} +6 \frac{\sigma ^6}{r_0^7} \big)&lt;br /&gt;
&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;&lt;br /&gt;
F(r_0)=48 \epsilon \frac {\sigma ^{12}}{r_0^{13}} -24 \epsilon \frac {\sigma ^6}{r_0^7}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;r_0= \sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)= \frac {48 \epsilon }{\sigma }- \frac {24 \epsilon }{\sigma }= \frac {24 \epsilon}{\sigma }&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the system to be at equilibrium, the force must equal 0.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; F_eq = -\frac{\phi (r)}{dr} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F_eq = 4 \epsilon (+12\frac{\sigma ^12}{r_i^{13}}-6\frac{\sigma ^6}{r_i^7}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 48\frac{\sigma ^{12}}{r_i^{13}}=24\frac{\sigma ^6}{r_i^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \sigma ^6 = r_i ^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth at this equilibrium distance can also be calculated, as shown below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon(\frac{\sigma}{\sqrt[6]{2}\sigma})^{12}-(\frac{\sigma}{\sqrt[6]{2}\sigma})^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \phi (r_{eq}) = 4\epsilon(\frac{1}{4}-\frac{1}{2}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon(-\frac{1}{4}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is often favourable to have a limit on the distance between atoms we consider the Lennard-Jones potential to occur over, as this constrains the number of calculations we must consider per atom. To investigate the size of the potential beyond certain points, we shall now look at the sum of the potentials over a range to infinity, using equation 6. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} \phi (r) dr=\int_{n}^{\infty} 4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)dr \ \ (6)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our reduced system, &amp;lt;math&amp;gt; \epsilon =\sigma =1&amp;lt;/math&amp;gt;. Therefore the integral can be equated as below:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} 4 \bigg( \frac{1}{r^{12}}-\frac{1}{r^{6}}\bigg) dr=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
4\bigg[ \frac {1}{5r^5}- \frac {1}{11r^{11}} \bigg]_n^{\infty}=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( [0]- \bigg( \frac{1}{5n^5} -\frac {1}{11n^{11}} \bigg) \bigg)=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( \frac {1}{11n^{11}}-\frac {1}{5n^5} \bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result for the lower bounds of values shown is shown in Table 2. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 2. Integral values for different values of n&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{2\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{3\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.024822443&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.008176748&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.003290128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This demonstrates that the potential of atoms interacting that are further than &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; away is negligible, and will be discard in our further calculations. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1 mL of water can be calculated to a good approximation as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \rho \approx 1&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; gcm^{-3}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;M_H20 \approx 18&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;gmol^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; N=\frac{\rho}{M_H20}\times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N=\frac{1}{18}\times6.023\times10^{23}=3.4\times10^{22} molecules&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also estimate the volume of 10000 water molecules:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{m}{\rho}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass: &amp;lt;math&amp;gt;m= \frac{10000}{6.023 \times 10^{23}} \times 18&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V=\frac{2.99\times10^{-19}}{1}=2.99\times10^{-19}ml&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Periodic boundary conditions mean that an atom leaving the unit cell is replaced by an atom entering the unit cell with the same velocity vector at the opposite side of the cell. Lets consider an atom at position (0.5, 0.5, 0.5), in a unit cell running from (0, 0, 0) to (1, 1, 1), moving along vector (0.7, 0.6, 0.2) in a single time-step. This would make the atom end up at (1.2, 1.1, 0.7), meaning it has left the unit cell. Thus, the atom is regenerated at (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
When using the Lennard-Jones potential we shall also be working in reduced units to make the values more workable. For example:&lt;br /&gt;
In argon, the Lennard-Jones parameters are - &amp;lt;math&amp;gt;\sigma = 0.34nm, \epsilon / k_B = 120K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A LJ cut off of &amp;lt;math&amp;gt;r* = 3.2&amp;lt;/math&amp;gt; would therefore equal &amp;lt;math&amp;gt; r = r*\sigma 0.34\times10^{-9}\times 3.2=1.088 \times10^{-9}=1.088 nm&amp;lt;/math&amp;gt; in real terms.&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; E=-\epsilon&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\epsilon=120k_B&amp;lt;/math&amp;gt; therefore  &amp;lt;math&amp;gt; E= 120k_B= 1.65678\times10^{-21} J = 0.99788 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;T = \frac{\epsilon T*}{k_B}= 1.5 \times 120=180&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Equilibration====&lt;br /&gt;
&lt;br /&gt;
An issue with random starting coordinates is a situation can arise where the atoms are randomly generated far closer than would occur in reality, in the region below r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. Here, the atoms will have more potential energy than usual, which will cause a large force to be applied in the first time step. This will result in an unrealistic model, as this could cause a disruption to the structure of the system and the energy distribution would be expected to exhibit a Boltzmann distribution around the energy of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Large repulsive forces will make the simulation unstable and cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If we consider a lattice spacing of 1.07722 for a cubic lattice, it relates to a number density of lattice points of 0.8. This can be calculated using equation 8: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \rho = \frac{n}{V} \ \ (8)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; = volume, &amp;lt;math&amp;gt; \rho&amp;lt;/math&amp;gt; = number density, &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = number density&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.07722^2}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face centred cubic lattice, there are a total of 4 lattice points per unit cell. For a number density of 1.2, the side the length of this unit cell can be calculated by rearranging equation 8.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \rho = \frac{n}{V}=\frac{n}{L^3} &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; L = \sqrt[3]{\frac{4}{1.2}}=1.49380 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
The section of the input file above commands the creation of a 10x10x10 array of unit cells, resulting in the creation of 1000 unit cells. Considering each contains 4 lattice points per unit cell, we can conclude 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LAMMPS file contains many other commands to build up the simulation. Others include:&lt;br /&gt;
 mass 1 1.0 - this defines the mass of types of atoms, here atom type 1 has a mass of 1&lt;br /&gt;
 pair_style lj/cut 3.0 - the limit for which the lennard jones potential is calculated, in this instance at r = 3&lt;br /&gt;
 pair_coeff * * 1.0 1.0 - this defines the &amp;quot;pairwise force field coefficients for one or more pairs of atom types&amp;quot;. An asterisks symbolises multiple atoms, and so this represents between all atom pairs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for the Lennard-Jones potential?.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the following simulations, we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;(0). Therefore the Velocity Verlet Algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
&lt;br /&gt;
We always wish to have the calculations taken over 100s. The line above,  &amp;quot;variable n_steps equal floor(100/${timestep})&amp;quot;, makes the steps a function of the timestep. These lines allow us to ensure the calculations are carried out over the set time period, regardless of the time step used, without having to calculate the number of time steps required ourselves.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, in general it is always better to set simulation parameters using variables as it means that the same script can be easily used to run a number of different simulations with different parameters.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The energy, pressure and temperature plots vs time for the 0.001 time-step are shown in Figures 5, 6 and 7. All the plots tend to an average value, showing that the simulation is reaching equilibrium. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR 0.001 energy.png|500x500px|thumb|center|Figure 5. Energy vs time using a 0.001s time-step]]&lt;br /&gt;
|[[File:FR 0.001 pressure.png|500x500px|thumb|center|Figure 6. Pressure vs time using a 0.001s time-step]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR 0.001 temperature.png|500x500px|thumb|center|Figure 7. Temperature vs time using a 0.001s time-step]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 5 shows the energy vs time for a time step of 0.001. It is obvious that this simulation reaches equilibrium as the graph tends to an average energy, after approximately 0.35s. Figure 8 shows the energy vs time for several time-steps all on one graph. The shorter the time-step, the better the simulation as shown by the smaller fluctuations in the graph once equilibrium has been reached. However, this requires more simulation steps for the same time period, thus requiring many more calculations. The 0.0025s time-step is the largest that tends to an average value similar to 0.001s and thus will be appropriate to use in further calculations to minimise time. The worst time step that could be taken out of those shown would be the 0.01s time-step, as the model doesn&#039;t tend to a value and demonstrating that it hasn&#039;t been able to reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
[[File:FR All time steps.png|500x500px|thumb|center|Figure 8. Energy vs time for multiple time steps]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the timestep so 0.0075 and 0.01 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Running simulations under specific conditions====&lt;br /&gt;
According to the equipartition theorem, each degree of freedom in a system at equilibrium with have &amp;lt;math&amp;gt;\frac{1}{2}k_BT&amp;lt;/math&amp;gt; energy. Considering our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms and 3 degrees of freedom, the kinetic energy of the system is shown in equation 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_k= \frac{3}{2} N k_B T=\frac{1}{2}\sum_i m_i v_i^2 \ \ (9)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the instantaneous temperature, T, fluctuates. We have a target temperature of &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, and to achieve this, we multiply each atoms velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to ensure the kinetic energy of the system isn&#039;t too high or too low. This gives equation 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which can be rewritten as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \frac{\mathfrak{T}}{\gamma^2} \ \ (11)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combining equations (9) and (11):&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T=\frac{\mathfrak{T}}{\gamma^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input file contains many over instructions. The following can be broken down to examine how the averages are being recorded:&lt;br /&gt;
&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
100 (Nevery): The average is taken from points that are Nevery time-steps apart&lt;br /&gt;
&lt;br /&gt;
1000 (Nrepeat): The average is taken over Nrepeat data points preceding the required averaged time-step, i.e. 1000.&lt;br /&gt;
&lt;br /&gt;
10000 (Nfreq): The final average quantities in the data file occurs on time-steps that are multiples of Nfreq.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphs of density vs temperature for a pressure of 2.5 and 3.0 are shown in figures 9 and 10 respectively. Both graphs originally have a large difference between the computer modelled density and the density calculated using van der Waals equation. This suggests that the van der Waals approximation is in fact too simple at low temperatures, as it assumes the gas behaves as an ideal gas, with no intermolecular interactions. In fact, at the lower temperatures, the gas molecules are close enough for attractive intermolecular interactions to be significant. This makes the gas denser than predicted as an ideal gas. However, as the temperature increases, the gas has more kinetic energy allowing the atoms to overcome the attractive forces and disperse more, meaning the intermolecular interactions become weaker. Thus the ideal gas and simulated densities have less of a difference at higher temperatures. This effect is greater at a higher pressure, as the molecules are pushed together more and so have greater intermolecular interactions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Is this what your graphs show?  The simulations are less dense than the ideal gas, not more dense, which suggests that the lack of repulsive interactions in the ideal gas is the most significant factor.  The ideal gas is a good approximation to a dilute (high temperature, low pressure) gas.  Plot all results on the same graph to see the trend with pressure more clearly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Dens temp 2.5.png|500x500px|thumb|center|Figure 9. Density vs Temperature for Pressure = 2.5]]&lt;br /&gt;
|[[File:FR Dens temp 2.5.png|500x500px|thumb|center|Figure 10. Density vs Temperature for Pressure = 3.0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Calculating heat capacities using statistical physics====&lt;br /&gt;
&lt;br /&gt;
It is possible to investigate the heat capacity of a system by considering the fluctuations in energy, using equation 12.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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} \ \ (12)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 11 shows the heat capacity per unit cell against the temperature for the system at two different densities. The heat capacity of a system depends on the ability to promote molecules into higher energy levels at the cost of thermal energy, thus absorbing this thermal energy without increase the temperature of the system. Therefore, the more accessible rotational and vibrational energy states in the system available for promotion, the higher heat capacity of the system. As the temperature increases, many of these states start to become thermally occupied, and further promotion begins to become less enthalpically favourable. &lt;br /&gt;
&lt;br /&gt;
Increasing the density means that there are now more atoms in the system, as we have kept the volume constant. This opens up the possibility of more rotational and vibrational energy level promotions before the states get saturated. Thus, the heat capacity is higher across the graph for the greater density.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR heatcapvol vs temp.png|600x600px|thumb|center|Figure 11. Heat Capacity per unit cell vs Temperature]]&lt;br /&gt;
|-&lt;br /&gt;
| Density = 0.2&lt;br /&gt;
| Density = 0.8&lt;br /&gt;
|-&lt;br /&gt;
| -1.15267900x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt; &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; + 3.63101786x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.35550105x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt; &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; +   5.10905370x10&amp;lt;sup&amp;gt;05&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;=0.92985&lt;br /&gt;
|R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;=0.93113&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Your simulations are of classical, spherical particles, so there are no rotational or vibrational energy levels.  However, you have the right idea to relate the heat capacity to the availability of energy levels, in this case the density of states.  The heat capacity increases with density because the amount of energy required to raise the temperature of the system is proportional to the number of atoms per unit volume.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script had to be edited to carry out these simulations. The input script used for a T* = 2.2 and &amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;* = 0.2 is shown below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.2&lt;br /&gt;
variable dens equal 0.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${dens}&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;
### 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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 atoms vol&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable atoms2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etotal v_etotal2 v_temp&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable aveetotal equal f_aves[1]&lt;br /&gt;
variable aveetotal2 equal f_aves[2]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avetemp2 equal f_aves[3]*f_aves[3]&lt;br /&gt;
variable heatcapvol equal ${atoms2}*(f_aves[2]-f_aves[1]*f_aves[1])/(${avetemp2}*${vol})&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;Ave E: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Ave E2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Atoms: ${atoms2}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capcity/Vol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Structural properties and the radial distribution function====&lt;br /&gt;
Figure 12 shows the Radial Distribution Function, or g(r), vs internuclear separation. The graph describes how the density of the system varies with the separation from the reference atom, or the likelihood of finding an atom at this distance from the reference atom. The integral of each phase is also shown in Figure 13, clearly showing that the density of a solid is much larger than the others, as more nuclei are found in the internuclear distance radius we have used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR RDF graphs.png|500x500px|thumb|center|Figure 12. RDF vs internuclear separation]]&lt;br /&gt;
|[[File:FR Rdf integral.png|500x500px|thumb|center|Figure 13. RDF integral vs internuclear separation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressure and temperature values were adjusted to allow us to investigate 3 different phases, solid, liquid and gas, of the system using a phase diagram&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;. All have a RDF of  &amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt; 0 at r = 0 to 1, as this is a region repulsive forces would be acting, and leading to a high potential. The first peak can be considered &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The easiest of the phases to analyse is the solid. As it is a solid, the atoms can generally be considered fixed, and it has the highest density of the 3 phases. In the short term separation, the graph displays sharp peaks. This demonstrates the high probability of the atom existing in a consistent lattice structure. There are four large peaks that drop in intensity but widen, showing the atoms to be located where expected but with small discrepancies in distance, broadening the peak. There are also smaller peaks, which represent defects in the crystal. The long range order is highly susceptible to defects, and that can be seen in the inconsistent peaks. &lt;br /&gt;
&lt;br /&gt;
The liquid exhibits ever broadening peaks, until they are no longer visible. This shows that although there is still lattice structure like in the solid, it is much less rigid. The neighbouring atoms are more likely to be found over a range of distances from the reference atom, giving wide peaks. &lt;br /&gt;
&lt;br /&gt;
The gas shows an even broader peak, demonstrating no real long range order. The system is fluid, and the least structured of all three.&lt;br /&gt;
&lt;br /&gt;
Figure 14 shows a fcc lattice. If we consider the light blue atom to be the reference atom, the first three peaks at r = 0.975, 1.425 and 1.725 correspond to the green atoms, the dark blue atoms and the yellow atoms respectively. The lattice spacing corresponds to the distance between the reference atom and the dark blue atoms, and is therefore 1.425. The reference atom is coordinated to 12 green atoms, 6 dark blue atoms and 24 yellow atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:FR Fcc unitcell.png|500x500px|thumb|center|Figure 14. A face centred cubic unit cell, with different colours corresponding to different internuclear separations from the light blue reference atom]]&lt;br /&gt;
&lt;br /&gt;
The integral of the RDF also shows notable differences for each state. It is expected that the magnitude of the integral at any distance is ordered solid&amp;gt;liquid&amp;gt;gas. The is expected due to the greater density of a solid, thus containing far more atoms per unit separation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The inconsistent peaks in the solid rdf are not due to defects, they are what you expect from an fcc lattice when you look at atoms separated by large distances.  The broadening of the peaks is due to atoms vibrating around their lattice sites.  The liquid has short range order, but no long range order.  Good diagram of an fcc lattice, how did you calculate the number of nearest neighbours, did you check by looking at the integral of the rdf at short distances?  What is the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Dynamical properties and the diffusion coefficient====&lt;br /&gt;
The mean squared displacement graphs for solid, liquid and gas are shown in Figures 15, 16 and 17 for both generated systems and the 1 million atom systems provided.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Gas msd.png|500x500px|thumb|center|Figure 15. Vapour MSD]]&lt;br /&gt;
|[[File:FR Liquid msd.png|500x500px|thumb|center|Figure 16. Liquid MSD]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR Solid msd.png|500x500px|thumb|center|Figure 17. Solid MSD]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graphs are as expected. Atoms in solids are the most rigidly held and the large spike initially may be down to a small movement within the lattice. However, the move is below the lattice spacing and the atom doesn&#039;t move any further than this for the entire simulation, showing a rigid structure. The liquid shows a maximum displacement of just over 5, which shows that the atom is no longer rigid and can flow through the system. However the largest MSD is found with the gas, as expected. Being the least intermolecularly bonded system allows atoms to almost freely diffuse through space, and this is shown in the graph and by the highest diffusion coefficient. The simulations using 1 million atoms are seen to be smoother, suggesting a more realistic system, as this is considering a larger system from which to take averages. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given in equation 13.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (13)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can therefore be calculated using the gradient of the MSD vs time graph, considering that each time-step represents 0.002s. The diffusion coefficients are shown in Table 3. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 3. Equations and coefficient of regressions used to calculate the diffusion coefficient, alongside the diffusion coefficient.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; | Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Simulation&lt;br /&gt;
|1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 5.8333333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.1666667x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|8.3333333x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333333x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
| 2.7000000&lt;br /&gt;
| 2.5416667&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plot the lines of best fit used to calculate D on the graphs.  Did you fit a straight line to all of the data or just the linear part?  Why does the gas phase MSD graph begin as a curved line (ballistic motion)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated using the velocity autocorrelation function, shown as equation 14.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)dt}{\int_{-\infty}^{\infty} v^2\left(t\right) dt} \ \ (14)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the 1D harmonic oscillator, we know:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)  =A\cos(\omega t + \phi) &amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt; v(t)=\frac{\delta x(t)}{\delta t}=-A \omega \sin(\omega t +\phi)&amp;lt;/math&amp;gt;. This can be combined with equation 13 as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega)\sin(\omega t+\phi)(-A\omega)\sin(\omega(t + \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} ((-A\omega)\sin(\omega t+\phi))^2\left(t\right)\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;C(\tau)= \frac{\int_{-\infty}^{\infty}\sin(\omega t + \phi) \sin(\omega t + \omega\tau+ \phi) dt}{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= \frac{\int_{-\infty}^{\infty}\sin(\omega t + \phi) (\sin(\omega t + \phi)\cos(\omega t)+\cos\left(\omega t + \phi\right)\sin(\omega t)))dt}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)dt} &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;C(\tau)= cos(\omega t)\frac{\int_{-\infty}^{\infty}(sin^{2}(\omega t + \phi))dt}{ \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) dt} + \sin(\omega t)\frac{\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))dt}{\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the first term, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}(sin^{2}(\omega t + \phi))dt&amp;lt;/math&amp;gt; cancels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= cos(\omega t) + sin(\omega t)\frac{\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))dt}{\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the denominated in the fraction in the second term, we have an odd function, squared, giving an even function and a non-zero integral. However, the numerator contains an odd function multiplied by an even function, giving an odd function. This will have an integral of zero between &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;+\infty&amp;lt;/math&amp;gt;, meaning the whole term is equal to zero. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= cos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 18 is a plot of the VACFs for both the liquid and the solid with a harmonic oscillator. The obvious observation is that the harmonic oscillator is not a good representation of either system, as it demonstrates a conservation of kinetic energy that is not visible with the solid or liquid states. The starting system only contains potential energy, depicted when the system is randomly generated, but this order is lost with time, and the velocities of atoms become uncorrelated to their starting value. The result is both systems have tend to a &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; of 0. &lt;br /&gt;
&lt;br /&gt;
The minima in these graphs represent a negative velocity compared to the starting velocity, or the return of the reference atom towards it&#039;s starting position. The solid has more of a rigid structure around it, and thus will hit barriers when travelling in one direction. It will rebound and head towards its original position and will continue to do this, thus the oscillations around 0. The liquid, however, is able to travel in one direction for much longer, simply losing kinetic energy through collisions until it&#039;s velocity is no longer connected with it&#039;s original value. &lt;br /&gt;
&lt;br /&gt;
[[File:FR Vcaf_vs_timestep.png|500x500px|thumb|center|Figure 18. VACF vs time step]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Collisions between particles randomise particle velocities and cause the VACF to decorrelate, there are no collisions in the harmonic oscillator simulation so its VACF never decays to zero.  It is not about conservation of kinetic energy.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By taking the integral of the VACF data, we can establish how far the particle has indeed diffused. The simulated data was integrated using the trapezium rule, as well as the provided data for 1 million atoms. From this, we can use equation 15 to establish the diffusion coefficient. The results are shown in table 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (15)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Gas vcaf integral.png|500x500px|thumb|center|Figure 19. Vapour MSD]]&lt;br /&gt;
|[[File:FR Liquid vcaf integral.png|500x500px|thumb|center|Figure 20. Liquid MSD]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR Solid vcaf integral.png|500x500px|thumb|center|Figure 21. Solid MSD]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 4. The diffusion coefficients calculated using the Velocity Autocorrelation Function for each phase.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; | Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Simulation&lt;br /&gt;
|1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| -1.8453896x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.5587537x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
| 9.7905916x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 9.0089602x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
| 3.2944994&lt;br /&gt;
| 3.2683770&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integrals here are rather interesting. For the solid, there involves a large increase initially, but this is reversed quickly, and the integral fluctuates around 0 after less than 500 time steps. This would suggest the initial movement to be something similar to a vibration, with the reference atom transferring it&#039;s initial kinetic energy to other atoms and rebounding after it&#039;s initial movement. Overall, the simulation for a solid provided a negative diffusion coefficient, which was surprising but understandable, as the reference atom was making small vibrational movements at this time and could well be in the negative vector direction at the end of the simulation. The liquid simulation shows a large degree of diffusion initially, but this falls away towards the end of the simulation. This suggests that the rate of diffusion slows for a liquid over time. This effect is also observed in the vapour stage but the initial diffusion is much higher. &lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are similar for the 1 million atoms and our smaller simulation, apart from for the solid, suggesting our simulation is well representative of the larger system. The values are also of reasonable comparison to the values from the MSD method we investigated earlier, suggesting both can be used to back up the other. &lt;br /&gt;
&lt;br /&gt;
One source of error in these calculation are using the trapezoid method for calculating the integral. We are limited to the size of the time-step in the original simulations, as this is the base of each individual trapezoid. Although it would require a longer computational time, a smaller time step would reduce any errors associated with this.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The diffusion constant is only equal to the value of the integral when it has plateaued, you cannot say whether the rate of diffusion changes over time from these graphs.  Since the simulations should be at equilibrium the diffusion coefficient should be constant too.  The diffusion coefficient cannot be negative theoretically, the solid diffusion coefficient is effectively zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Conclusion====&lt;br /&gt;
The importance of a small time step was established early in the experiment, as this meant that there were not large jumps between snapshots in which we were unaware of the interactions between atoms. However, it was clear that a compromise must be made between accuracy and computational time, as a smaller time step meant more calculations were required per run. The Lennard-Jones interaction model was used, and it was found that we could discard interactions above a certain internuclear distance, as this would again reduce the required calculations. We delved into the LAMMPS input script, allowing us to edit it to investigate different ensembles. &lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature were made, demonstrating how the van der Waal&#039;s model is a poor approximation at low temperature due to intermolecular forces. This error was found to also be larger for greater pressures. The heat capacity per unit cell was also plotted against temperature, and this was found to decrease with an increase in temperature as it gets thermodynamically less favourable to undergo further promotions in energy states. The heat capacity was greater for higher densities, due to more atoms being available for excitation. The RDFs were plotted for three different phases, and showed the solid phase to exhibit much stronger structural order than the other two, as expected. The three phases could be easily distinguished using this computational method. The diffusion coefficient was calculated using two different methods. Although there were slight discrepancies, the values returned were similar using both methods.&lt;br /&gt;
&lt;br /&gt;
====References====&lt;br /&gt;
[1] Ercolessi, F. (1997). &#039;&#039;The Verlet algorithm.&#039;&#039; [online] Available at: http://www.citethisforme.com/guides/harvard/how-to-cite-a-website [Accessed 06/03/17].&lt;br /&gt;
&lt;br /&gt;
[2] Hansen, J and Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. &#039;&#039;Phys. Rev.&#039;&#039; 184, 151.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:FRMD&amp;diff=612376</id>
		<title>Talk:Mod:FRMD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:FRMD&amp;diff=612376"/>
		<updated>2017-04-02T22:40:17Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  ====Introduction==== Molecular dynamics can be used in many situations where a real life experiment may not be fea...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Introduction====&lt;br /&gt;
Molecular dynamics can be used in many situations where a real life experiment may not be feasible. Being able to run highly sophisticated computer simulations can provide an insight into a wide range of real life systems, and to remarkable accuracy. It can be used to calculate the position, velocity and appropriate force of an atom to measure thermodynamic properties such as a system&#039;s energy, volume, heat capacity and temperature, all from the comfort of a desk, and without the need to ever wear a lab coat. The core principle behind it is the solving of Newton&#039;s equations of motion for a system of interacting particles, at a snapshot in time. These are dependent on a previous conditions, and these snapshots are built up to form an overall picture. Statistical physics enables us to take all the individual properties and combine them, to form a replica of a real life system.&lt;br /&gt;
&lt;br /&gt;
For this experiment, the Large-scale Atomic/Molecular Massively Parallel Simulator, or LAMMPS software was used. After optimising the accuracy of the simulation, density, heat capacity and diffusion coefficient were investigate, for solid, liquid and vapour states.&lt;br /&gt;
&lt;br /&gt;
====Introduction to molecular dynamics simulation====&lt;br /&gt;
The velocity verlet algorithm considers the acceleration of an atom to be dependent on its position, and was used to calculate the velocities and positions at snapshots in time. &lt;br /&gt;
&lt;br /&gt;
Initially, we used this algorithm to model a simple harmonic oscillator. To assess it&#039;s accuracy, a classical simple harmonic oscillator was also modelled, and the position of an atom from this model is shown in equation 1. For our calculations, &amp;lt;math&amp;gt; \phi = 0 \ \   A = 1.00 \ \  \omega = 1.00 &amp;lt;/math&amp;gt;. The total energy was calculated from the sum of the kinetic and potential energy, shown in equation 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; x(t) = A \cos(\omega t + \phi) \ \ (1) &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; E = K + U = \frac{1}{2}mv^2+\frac{1}{2}kx^2 \ \ (2) &amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a timestep of 0.1s, the two models are shown in figure 1. The error between the two models is shown in figure 2, and the maxima can be connected using a linear fit, &lt;br /&gt;
of equation &amp;lt;math&amp;gt;4.21552195\times10^{-4}x-7.3021874\times10^{-5}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| [[File:FR Displacement vs t.png|500x500px|thumb|center|Figure 1. Displacement vs time using the velocity-varlet algorithm]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| [[File:FR Max error vs t.png|500x500px|thumb|center|Figure 2. The absolute error between the classical solution and the velocity-varlet solution]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation occurs over the course of 100s, meaning the error is much larger towards the end of the simulation, due to the error being a function of time. Figure 3 shows the maximum errors associated with several time steps, and shows a dramatic enhancement in the accuracy of the model by reducing the time step by a factor of 10. This results in a reduction in absolute error by a factor of 100.&lt;br /&gt;
 &lt;br /&gt;
[[File:FR Max error several time stepsvs t.png|500x500px|thumb|center|Figure 3. Absolute error for several time steps]]&lt;br /&gt;
&lt;br /&gt;
The total energy of the system also oscillates slightly, as shown in figure 4. As the system is meant to be isolated, the total energy should remain constant and so it is important to monitor the total energy to ensure the model is representative of the real life situation it is trying to replicate. These oscillations can be reduced by reducing the time between the measured snapshots, as the velocity verlet algorithm endures an error in the calculation of the position and velocity. This is due to both calculations involving the multiplication of a previously calculated value by the &amp;lt;math&amp;gt; \delta t&amp;lt;/math&amp;gt;. The error for the algorithm for position can be derived to be &amp;lt;math&amp;gt;O(\Delta t^4)&amp;lt;/math&amp;gt; and for velocity is &amp;lt;math&amp;gt;O( \Delta t^2)&amp;lt;/math&amp;gt;&amp;lt;sup&amp;gt;[1]&amp;lt;/sup&amp;gt;. More importantly for large scale molecular dynamics, the global error for both is &amp;lt;math&amp;gt;O(\Delta t^2)&amp;lt;/math&amp;gt;. The percentage error in calculating the total energy is therefore shown in Table 1. In order to achieve a total energy change of under 1%, a timestep of under 0.2s should be used.&lt;br /&gt;
&lt;br /&gt;
[[File:FR Energy 0.1.png|500x500px|thumb|center|Figure 4. Total energy vs time for a time step of 0.1s ]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Table 1. Energy percentage error for different time steps.&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot; | &lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; style=&amp;quot;text-align: center;&amp;quot; | Energy&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;text-align: center;&amp;quot; | Lowest Value&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | Highest Value&lt;br /&gt;
! style=&amp;quot;text-align: center;&amp;quot; | % error&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.50s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.468750&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 6.6667&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.25s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.492188&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 1.5873&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.20s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.495000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 1.0101&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.10s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.498750&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.2506&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot; |&#039;&#039;&#039;0.01s&#039;&#039;&#039;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.499988&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.500000 &lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.0025&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We are choosing to model the system using the Lennard-Jones interaction, which is described in Equation 3. This keeps us within the realms of classical mechanics, and avoids the need to delve into quantum physics.&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\} \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
For a single interaction, this can be simplified.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi (r)=4\epsilon( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}) \ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction, the separation,&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is 0 is calculated below. &lt;br /&gt;
&amp;lt;center&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0=4\epsilon \big( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\big)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\ \frac{\sigma^{12}}{r_0^{12}}=\frac{\sigma^{6}}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6}=r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;or&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=-\sigma &amp;lt;/math&amp;gt; (&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is positive, therefore &amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;)&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force acting on an object at a given potential is shown in equation 5.&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F_i=-\frac{d \phi (r^N)}{dr_i} \ \ (5)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the force at &amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt; is shown below:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=\frac{\phi (r)}{dr} = -4 \epsilon \big( -12 \frac {\sigma ^{12}}{r_0^{13}} +6 \frac{\sigma ^6}{r_0^7} \big)&lt;br /&gt;
&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;&lt;br /&gt;
F(r_0)=48 \epsilon \frac {\sigma ^{12}}{r_0^{13}} -24 \epsilon \frac {\sigma ^6}{r_0^7}&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;r_0= \sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)= \frac {48 \epsilon }{\sigma }- \frac {24 \epsilon }{\sigma }= \frac {24 \epsilon}{\sigma }&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the system to be at equilibrium, the force must equal 0.&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; F_eq = -\frac{\phi (r)}{dr} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F_eq = 4 \epsilon (+12\frac{\sigma ^12}{r_i^{13}}-6\frac{\sigma ^6}{r_i^7}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 48\frac{\sigma ^{12}}{r_i^{13}}=24\frac{\sigma ^6}{r_i^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;2 \sigma ^6 = r_i ^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth at this equilibrium distance can also be calculated, as shown below:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon(\frac{\sigma}{\sqrt[6]{2}\sigma})^{12}-(\frac{\sigma}{\sqrt[6]{2}\sigma})^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \phi (r_{eq}) = 4\epsilon(\frac{1}{4}-\frac{1}{2}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4\epsilon(-\frac{1}{4}) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is often favourable to have a limit on the distance between atoms we consider the Lennard-Jones potential to occur over, as this constrains the number of calculations we must consider per atom. To investigate the size of the potential beyond certain points, we shall now look at the sum of the potentials over a range to infinity, using equation 6. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} \phi (r) dr=\int_{n}^{\infty} 4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)dr \ \ (6)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For our reduced system, &amp;lt;math&amp;gt; \epsilon =\sigma =1&amp;lt;/math&amp;gt;. Therefore the integral can be equated as below:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} 4 \bigg( \frac{1}{r^{12}}-\frac{1}{r^{6}}\bigg) dr=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
4\bigg[ \frac {1}{5r^5}- \frac {1}{11r^{11}} \bigg]_n^{\infty}=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( [0]- \bigg( \frac{1}{5n^5} -\frac {1}{11n^{11}} \bigg) \bigg)=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( \frac {1}{11n^{11}}-\frac {1}{5n^5} \bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result for the lower bounds of values shown is shown in Table 2. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 2. Integral values for different values of n&lt;br /&gt;
|-&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{2\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
! &amp;lt;math&amp;gt;\int_{3\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.024822443&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.008176748&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|-0.003290128&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This demonstrates that the potential of atoms interacting that are further than &amp;lt;math&amp;gt;3\sigma&amp;lt;/math&amp;gt; away is negligible, and will be discard in our further calculations. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in 1 mL of water can be calculated to a good approximation as follows:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \rho \approx 1&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; gcm^{-3}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;M_H20 \approx 18&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;gmol^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; N=\frac{\rho}{M_H20}\times N_A &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N=\frac{1}{18}\times6.023\times10^{23}=3.4\times10^{22} molecules&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also estimate the volume of 10000 water molecules:&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{m}{\rho}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass: &amp;lt;math&amp;gt;m= \frac{10000}{6.023 \times 10^{23}} \times 18&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V=\frac{2.99\times10^{-19}}{1}=2.99\times10^{-19}ml&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Periodic boundary conditions mean that an atom leaving the unit cell is replaced by an atom entering the unit cell with the same velocity vector at the opposite side of the cell. Lets consider an atom at position (0.5, 0.5, 0.5), in a unit cell running from (0, 0, 0) to (1, 1, 1), moving along vector (0.7, 0.6, 0.2) in a single time-step. This would make the atom end up at (1.2, 1.1, 0.7), meaning it has left the unit cell. Thus, the atom is regenerated at (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
When using the Lennard-Jones potential we shall also be working in reduced units to make the values more workable. For example:&lt;br /&gt;
In argon, the Lennard-Jones parameters are - &amp;lt;math&amp;gt;\sigma = 0.34nm, \epsilon / k_B = 120K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A LJ cut off of &amp;lt;math&amp;gt;r* = 3.2&amp;lt;/math&amp;gt; would therefore equal &amp;lt;math&amp;gt; r = r*\sigma 0.34\times10^{-9}\times 3.2=1.088 \times10^{-9}=1.088 nm&amp;lt;/math&amp;gt; in real terms.&lt;br /&gt;
&lt;br /&gt;
The well depth, &amp;lt;math&amp;gt; E=-\epsilon&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;\epsilon=120k_B&amp;lt;/math&amp;gt; therefore  &amp;lt;math&amp;gt; E= 120k_B= 1.65678\times10^{-21} J = 0.99788 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;T = \frac{\epsilon T*}{k_B}= 1.5 \times 120=180&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Equilibration====&lt;br /&gt;
&lt;br /&gt;
An issue with random starting coordinates is a situation can arise where the atoms are randomly generated far closer than would occur in reality, in the region below r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;. Here, the atoms will have more potential energy than usual, which will cause a large force to be applied in the first time step. This will result in an unrealistic model, as this could cause a disruption to the structure of the system and the energy distribution would be expected to exhibit a Boltzmann distribution around the energy of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Large repulsive forces will make the simulation unstable and cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If we consider a lattice spacing of 1.07722 for a cubic lattice, it relates to a number density of lattice points of 0.8. This can be calculated using equation 8: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \rho = \frac{n}{V} \ \ (8)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; V &amp;lt;/math&amp;gt; = volume, &amp;lt;math&amp;gt; \rho&amp;lt;/math&amp;gt; = number density, &amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = number density&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.07722^2}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face centred cubic lattice, there are a total of 4 lattice points per unit cell. For a number density of 1.2, the side the length of this unit cell can be calculated by rearranging equation 8.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \rho = \frac{n}{V}=\frac{n}{L^3} &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; L = \sqrt[3]{\frac{4}{1.2}}=1.49380 &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
The section of the input file above commands the creation of a 10x10x10 array of unit cells, resulting in the creation of 1000 unit cells. Considering each contains 4 lattice points per unit cell, we can conclude 4000 atoms will be created.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LAMMPS file contains many other commands to build up the simulation. Others include:&lt;br /&gt;
 mass 1 1.0 - this defines the mass of types of atoms, here atom type 1 has a mass of 1&lt;br /&gt;
 pair_style lj/cut 3.0 - the limit for which the lennard jones potential is calculated, in this instance at r = 3&lt;br /&gt;
 pair_coeff * * 1.0 1.0 - this defines the &amp;quot;pairwise force field coefficients for one or more pairs of atom types&amp;quot;. An asterisks symbolises multiple atoms, and so this represents between all atom pairs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for the Lennard-Jones potential?.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the following simulations, we are specifying x&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;(0). Therefore the Velocity Verlet Algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
 ### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
&lt;br /&gt;
We always wish to have the calculations taken over 100s. The line above,  &amp;quot;variable n_steps equal floor(100/${timestep})&amp;quot;, makes the steps a function of the timestep. These lines allow us to ensure the calculations are carried out over the set time period, regardless of the time step used, without having to calculate the number of time steps required ourselves.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, in general it is always better to set simulation parameters using variables as it means that the same script can be easily used to run a number of different simulations with different parameters.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The energy, pressure and temperature plots vs time for the 0.001 time-step are shown in Figures 5, 6 and 7. All the plots tend to an average value, showing that the simulation is reaching equilibrium. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR 0.001 energy.png|500x500px|thumb|center|Figure 5. Energy vs time using a 0.001s time-step]]&lt;br /&gt;
|[[File:FR 0.001 pressure.png|500x500px|thumb|center|Figure 6. Pressure vs time using a 0.001s time-step]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR 0.001 temperature.png|500x500px|thumb|center|Figure 7. Temperature vs time using a 0.001s time-step]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 5 shows the energy vs time for a time step of 0.001. It is obvious that this simulation reaches equilibrium as the graph tends to an average energy, after approximately 0.35s. Figure 8 shows the energy vs time for several time-steps all on one graph. The shorter the time-step, the better the simulation as shown by the smaller fluctuations in the graph once equilibrium has been reached. However, this requires more simulation steps for the same time period, thus requiring many more calculations. The 0.0025s time-step is the largest that tends to an average value similar to 0.001s and thus will be appropriate to use in further calculations to minimise time. The worst time step that could be taken out of those shown would be the 0.01s time-step, as the model doesn&#039;t tend to a value and demonstrating that it hasn&#039;t been able to reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
[[File:FR All time steps.png|500x500px|thumb|center|Figure 8. Energy vs time for multiple time steps]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the timestep so 0.0075 and 0.01 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Running simulations under specific conditions====&lt;br /&gt;
According to the equipartition theorem, each degree of freedom in a system at equilibrium with have &amp;lt;math&amp;gt;\frac{1}{2}k_BT&amp;lt;/math&amp;gt; energy. Considering our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms and 3 degrees of freedom, the kinetic energy of the system is shown in equation 9.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_k= \frac{3}{2} N k_B T=\frac{1}{2}\sum_i m_i v_i^2 \ \ (9)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the instantaneous temperature, T, fluctuates. We have a target temperature of &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, and to achieve this, we multiply each atoms velocity by a constant, &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, in order to ensure the kinetic energy of the system isn&#039;t too high or too low. This gives equation 10.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which can be rewritten as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(v_i\right)^2 = \frac{3}{2} N k_B \frac{\mathfrak{T}}{\gamma^2} \ \ (11)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Combining equations (9) and (11):&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T=\frac{\mathfrak{T}}{\gamma^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input file contains many over instructions. The following can be broken down to examine how the averages are being recorded:&lt;br /&gt;
&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&lt;br /&gt;
100 (Nevery): The average is taken from points that are Nevery time-steps apart&lt;br /&gt;
&lt;br /&gt;
1000 (Nrepeat): The average is taken over Nrepeat data points preceding the required averaged time-step, i.e. 1000.&lt;br /&gt;
&lt;br /&gt;
10000 (Nfreq): The final average quantities in the data file occurs on time-steps that are multiples of Nfreq.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphs of density vs temperature for a pressure of 2.5 and 3.0 are shown in figures 9 and 10 respectively. Both graphs originally have a large difference between the computer modelled density and the density calculated using van der Waals equation. This suggests that the van der Waals approximation is in fact too simple at low temperatures, as it assumes the gas behaves as an ideal gas, with no intermolecular interactions. In fact, at the lower temperatures, the gas molecules are close enough for attractive intermolecular interactions to be significant. This makes the gas denser than predicted as an ideal gas. However, as the temperature increases, the gas has more kinetic energy allowing the atoms to overcome the attractive forces and disperse more, meaning the intermolecular interactions become weaker. Thus the ideal gas and simulated densities have less of a difference at higher temperatures. This effect is greater at a higher pressure, as the molecules are pushed together more and so have greater intermolecular interactions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Is this what your graphs show?  The simulations are less dense than the ideal gas, not more dense, which suggests that the lack of repulsive interactions in the ideal gas is the most significant factor.  The ideal gas is a good approximation to a dilute (high temperature, low pressure) gas.  Plot all results on the same graph to see the trend with pressure more clearly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Dens temp 2.5.png|500x500px|thumb|center|Figure 9. Density vs Temperature for Pressure = 2.5]]&lt;br /&gt;
|[[File:FR Dens temp 2.5.png|500x500px|thumb|center|Figure 10. Density vs Temperature for Pressure = 3.0]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Calculating heat capacities using statistical physics====&lt;br /&gt;
&lt;br /&gt;
It is possible to investigate the heat capacity of a system by considering the fluctuations in energy, using equation 12.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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} \ \ (12)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 11 shows the heat capacity per unit cell against the temperature for the system at two different densities. The heat capacity of a system depends on the ability to promote molecules into higher energy levels at the cost of thermal energy, thus absorbing this thermal energy without increase the temperature of the system. Therefore, the more accessible rotational and vibrational energy states in the system available for promotion, the higher heat capacity of the system. As the temperature increases, many of these states start to become thermally occupied, and further promotion begins to become less enthalpically favourable. &lt;br /&gt;
&lt;br /&gt;
Increasing the density means that there are now more atoms in the system, as we have kept the volume constant. This opens up the possibility of more rotational and vibrational energy level promotions before the states get saturated. Thus, the heat capacity is higher across the graph for the greater density.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR heatcapvol vs temp.png|600x600px|thumb|center|Figure 11. Heat Capacity per unit cell vs Temperature]]&lt;br /&gt;
|-&lt;br /&gt;
| Density = 0.2&lt;br /&gt;
| Density = 0.8&lt;br /&gt;
|-&lt;br /&gt;
| -1.15267900x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt; &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; + 3.63101786x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -1.35550105x10&amp;lt;sup&amp;gt;-05&amp;lt;/sup&amp;gt; &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; +   5.10905370x10&amp;lt;sup&amp;gt;05&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;=0.92985&lt;br /&gt;
|R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;=0.93113&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Your simulations are of classical, spherical particles, so there are no rotational or vibrational energy levels.  However, you have the right idea to relate the heat capacity to the availability of energy levels, in this case the density of states.  The heat capacity increases with density because the amount of energy required to raise the temperature of the system is proportional to the number of atoms per unit volume.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script had to be edited to carry out these simulations. The input script used for a T* = 2.2 and &amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt;* = 0.2 is shown below. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.2&lt;br /&gt;
variable dens equal 0.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${dens}&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;
### 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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 atoms vol&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable atoms2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etotal v_etotal2 v_temp&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable aveetotal equal f_aves[1]&lt;br /&gt;
variable aveetotal2 equal f_aves[2]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avetemp2 equal f_aves[3]*f_aves[3]&lt;br /&gt;
variable heatcapvol equal ${atoms2}*(f_aves[2]-f_aves[1]*f_aves[1])/(${avetemp2}*${vol})&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;Ave E: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Ave E2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Atoms: ${atoms2}&amp;quot;&lt;br /&gt;
print &amp;quot;Temp: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capcity/Vol: ${heatcapvol}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Structural properties and the radial distribution function====&lt;br /&gt;
Figure 12 shows the Radial Distribution Function, or g(r), vs internuclear separation. The graph describes how the density of the system varies with the separation from the reference atom, or the likelihood of finding an atom at this distance from the reference atom. The integral of each phase is also shown in Figure 13, clearly showing that the density of a solid is much larger than the others, as more nuclei are found in the internuclear distance radius we have used.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR RDF graphs.png|500x500px|thumb|center|Figure 12. RDF vs internuclear separation]]&lt;br /&gt;
|[[File:FR Rdf integral.png|500x500px|thumb|center|Figure 13. RDF integral vs internuclear separation]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The pressure and temperature values were adjusted to allow us to investigate 3 different phases, solid, liquid and gas, of the system using a phase diagram&amp;lt;sup&amp;gt;[2]&amp;lt;/sup&amp;gt;. All have a RDF of  &amp;lt;math&amp;gt;\approx&amp;lt;/math&amp;gt; 0 at r = 0 to 1, as this is a region repulsive forces would be acting, and leading to a high potential. The first peak can be considered &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The easiest of the phases to analyse is the solid. As it is a solid, the atoms can generally be considered fixed, and it has the highest density of the 3 phases. In the short term separation, the graph displays sharp peaks. This demonstrates the high probability of the atom existing in a consistent lattice structure. There are four large peaks that drop in intensity but widen, showing the atoms to be located where expected but with small discrepancies in distance, broadening the peak. There are also smaller peaks, which represent defects in the crystal. The long range order is highly susceptible to defects, and that can be seen in the inconsistent peaks. &lt;br /&gt;
&lt;br /&gt;
The liquid exhibits ever broadening peaks, until they are no longer visible. This shows that although there is still lattice structure like in the solid, it is much less rigid. The neighbouring atoms are more likely to be found over a range of distances from the reference atom, giving wide peaks. &lt;br /&gt;
&lt;br /&gt;
The gas shows an even broader peak, demonstrating no real long range order. The system is fluid, and the least structured of all three.&lt;br /&gt;
&lt;br /&gt;
Figure 14 shows a fcc lattice. If we consider the light blue atom to be the reference atom, the first three peaks at r = 0.975, 1.425 and 1.725 correspond to the green atoms, the dark blue atoms and the yellow atoms respectively. The lattice spacing corresponds to the distance between the reference atom and the dark blue atoms, and is therefore 1.425. The reference atom is coordinated to 12 green atoms, 6 dark blue atoms and 24 yellow atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:FR Fcc unitcell.png|500x500px|thumb|center|Figure 14. A face centred cubic unit cell, with different colours corresponding to different internuclear separations from the light blue reference atom]]&lt;br /&gt;
&lt;br /&gt;
The integral of the RDF also shows notable differences for each state. It is expected that the magnitude of the integral at any distance is ordered solid&amp;gt;liquid&amp;gt;gas. The is expected due to the greater density of a solid, thus containing far more atoms per unit separation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The broadening of the solid RDF peaks is due to atoms vibrating around their lattice points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Dynamical properties and the diffusion coefficient====&lt;br /&gt;
The mean squared displacement graphs for solid, liquid and gas are shown in Figures 15, 16 and 17 for both generated systems and the 1 million atom systems provided.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Gas msd.png|500x500px|thumb|center|Figure 15. Vapour MSD]]&lt;br /&gt;
|[[File:FR Liquid msd.png|500x500px|thumb|center|Figure 16. Liquid MSD]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR Solid msd.png|500x500px|thumb|center|Figure 17. Solid MSD]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graphs are as expected. Atoms in solids are the most rigidly held and the large spike initially may be down to a small movement within the lattice. However, the move is below the lattice spacing and the atom doesn&#039;t move any further than this for the entire simulation, showing a rigid structure. The liquid shows a maximum displacement of just over 5, which shows that the atom is no longer rigid and can flow through the system. However the largest MSD is found with the gas, as expected. Being the least intermolecularly bonded system allows atoms to almost freely diffuse through space, and this is shown in the graph and by the highest diffusion coefficient. The simulations using 1 million atoms are seen to be smoother, suggesting a more realistic system, as this is considering a larger system from which to take averages. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given in equation 13.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t} \ \ (13)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can therefore be calculated using the gradient of the MSD vs time graph, considering that each time-step represents 0.002s. The diffusion coefficients are shown in Table 3. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 3. Equations and coefficient of regressions used to calculate the diffusion coefficient, alongside the diffusion coefficient.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; | Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Simulation&lt;br /&gt;
|1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| 5.8333333x10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.1666667x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|8.3333333x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.3333333x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
| 2.7000000&lt;br /&gt;
| 2.5416667&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated using the velocity autocorrelation function, shown as equation 14.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)dt}{\int_{-\infty}^{\infty} v^2\left(t\right) dt} \ \ (14)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the 1D harmonic oscillator, we know:&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)  =A\cos(\omega t + \phi) &amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt; v(t)=\frac{\delta x(t)}{\delta t}=-A \omega \sin(\omega t +\phi)&amp;lt;/math&amp;gt;. This can be combined with equation 13 as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} (-A\omega)\sin(\omega t+\phi)(-A\omega)\sin(\omega(t + \tau)+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} ((-A\omega)\sin(\omega t+\phi))^2\left(t\right)\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;C(\tau)= \frac{\int_{-\infty}^{\infty}\sin(\omega t + \phi) \sin(\omega t + \omega\tau+ \phi) dt}{\int_{-\infty}^{\infty} \sin^2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= \frac{\int_{-\infty}^{\infty}\sin(\omega t + \phi) (\sin(\omega t + \phi)\cos(\omega t)+\cos\left(\omega t + \phi\right)\sin(\omega t)))dt}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)dt} &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;C(\tau)= cos(\omega t)\frac{\int_{-\infty}^{\infty}(sin^{2}(\omega t + \phi))dt}{ \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) dt} + \sin(\omega t)\frac{\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))dt}{\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the first term, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}(sin^{2}(\omega t + \phi))dt&amp;lt;/math&amp;gt; cancels. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= cos(\omega t) + sin(\omega t)\frac{\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))dt}{\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) dt}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the denominated in the fraction in the second term, we have an odd function, squared, giving an even function and a non-zero integral. However, the numerator contains an odd function multiplied by an even function, giving an odd function. This will have an integral of zero between &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;+\infty&amp;lt;/math&amp;gt;, meaning the whole term is equal to zero. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)= cos(\omega t) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 18 is a plot of the VACFs for both the liquid and the solid with a harmonic oscillator. The obvious observation is that the harmonic oscillator is not a good representation of either system, as it demonstrates a conservation of kinetic energy that is not visible with the solid or liquid states. The starting system only contains potential energy, depicted when the system is randomly generated, but this order is lost with time, and the velocities of atoms become uncorrelated to their starting value. The result is both systems have tend to a &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; of 0. &lt;br /&gt;
&lt;br /&gt;
The minima in these graphs represent a negative velocity compared to the starting velocity, or the return of the reference atom towards it&#039;s starting position. The solid has more of a rigid structure around it, and thus will hit barriers when travelling in one direction. It will rebound and head towards its original position and will continue to do this, thus the oscillations around 0. The liquid, however, is able to travel in one direction for much longer, simply losing kinetic energy through collisions until it&#039;s velocity is no longer connected with it&#039;s original value. &lt;br /&gt;
&lt;br /&gt;
[[File:FR Vcaf_vs_timestep.png|500x500px|thumb|center|Figure 18. VACF vs time step]]&lt;br /&gt;
&lt;br /&gt;
By taking the integral of the VACF data, we can establish how far the particle has indeed diffused. The simulated data was integrated using the trapezium rule, as well as the provided data for 1 million atoms. From this, we can use equation 15 to establish the diffusion coefficient. The results are shown in table 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \ \ (15)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:FR Gas vcaf integral.png|500x500px|thumb|center|Figure 19. Vapour MSD]]&lt;br /&gt;
|[[File:FR Liquid vcaf integral.png|500x500px|thumb|center|Figure 20. Liquid MSD]]&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;2&amp;quot; | [[File:FR Solid vcaf integral.png|500x500px|thumb|center|Figure 21. Solid MSD]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+Table 4. The diffusion coefficients calculated using the Velocity Autocorrelation Function for each phase.&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot; | Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|Simulation&lt;br /&gt;
|1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
| Solid&lt;br /&gt;
| -1.8453896x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.5587537x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
| 9.7905916x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 9.0089602x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
| 3.2944994&lt;br /&gt;
| 3.2683770&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The running integrals here are rather interesting. For the solid, there involves a large increase initially, but this is reversed quickly, and the integral fluctuates around 0 after less than 500 time steps. This would suggest the initial movement to be something similar to a vibration, with the reference atom transferring it&#039;s initial kinetic energy to other atoms and rebounding after it&#039;s initial movement. Overall, the simulation for a solid provided a negative diffusion coefficient, which was surprising but understandable, as the reference atom was making small vibrational movements at this time and could well be in the negative vector direction at the end of the simulation. The liquid simulation shows a large degree of diffusion initially, but this falls away towards the end of the simulation. This suggests that the rate of diffusion slows for a liquid over time. This effect is also observed in the vapour stage but the initial diffusion is much higher. &lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are similar for the 1 million atoms and our smaller simulation, apart from for the solid, suggesting our simulation is well representative of the larger system. The values are also of reasonable comparison to the values from the MSD method we investigated earlier, suggesting both can be used to back up the other. &lt;br /&gt;
&lt;br /&gt;
One source of error in these calculation are using the trapezoid method for calculating the integral. We are limited to the size of the time-step in the original simulations, as this is the base of each individual trapezoid. Although it would require a longer computational time, a smaller time step would reduce any errors associated with this.&lt;br /&gt;
&lt;br /&gt;
====Conclusion====&lt;br /&gt;
The importance of a small time step was established early in the experiment, as this meant that there were not large jumps between snapshots in which we were unaware of the interactions between atoms. However, it was clear that a compromise must be made between accuracy and computational time, as a smaller time step meant more calculations were required per run. The Lennard-Jones interaction model was used, and it was found that we could discard interactions above a certain internuclear distance, as this would again reduce the required calculations. We delved into the LAMMPS input script, allowing us to edit it to investigate different ensembles. &lt;br /&gt;
&lt;br /&gt;
Plots of density vs temperature were made, demonstrating how the van der Waal&#039;s model is a poor approximation at low temperature due to intermolecular forces. This error was found to also be larger for greater pressures. The heat capacity per unit cell was also plotted against temperature, and this was found to decrease with an increase in temperature as it gets thermodynamically less favourable to undergo further promotions in energy states. The heat capacity was greater for higher densities, due to more atoms being available for excitation. The RDFs were plotted for three different phases, and showed the solid phase to exhibit much stronger structural order than the other two, as expected. The three phases could be easily distinguished using this computational method. The diffusion coefficient was calculated using two different methods. Although there were slight discrepancies, the values returned were similar using both methods.&lt;br /&gt;
&lt;br /&gt;
====References====&lt;br /&gt;
[1] Ercolessi, F. (1997). &#039;&#039;The Verlet algorithm.&#039;&#039; [online] Available at: http://www.citethisforme.com/guides/harvard/how-to-cite-a-website [Accessed 06/03/17].&lt;br /&gt;
&lt;br /&gt;
[2] Hansen, J and Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. &#039;&#039;Phys. Rev.&#039;&#039; 184, 151.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:P0TAT0&amp;diff=612359</id>
		<title>Talk:Mod:P0TAT0</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:P0TAT0&amp;diff=612359"/>
		<updated>2017-03-29T05:40:40Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered, but a few parts missing from some questions.  Make sure that you fully understand the theory behind this experiment and what you are being asked to calculate and plot in each task.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Molecular Dynamics Simulations of Simple Liquids =&lt;br /&gt;
[[User:Ab9314|Ab9314]] ([[User talk:Ab9314|talk]]) 11:11, 24 March 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics (MD) is a method to simulate the motion of many particles by numerically integrating Newton&#039;s Laws of Motion over time. The simulation can be conducted in an ensemble, e.g. NVT or NVE, by setting limits on temperatures and pressures (thermostatting and barostatting respectively).&amp;lt;ref name=sutmann&amp;gt;{{cite journal | author1=Godehard Suttman | year=2002 | title=Classical Molecular Dynamics| journal=NIC Series | volume=10 | ISBN=3-00-009057-6 | pages=211-254 | doi=|10.1016/0364-5916(91)90030-N}}&amp;gt;&amp;lt;/ref&amp;gt; MD can be used to simulate the behaviour of protein folding, lipid bilayers, and other biological systems, thereby making this a very practical and convenient way to experiment with complex systems.&amp;lt;ref name=biological_apps&amp;gt;{{cite journal | author1=Karplus, Martin | year=2002 | title=Molecular dynamics simulations of biomolecules| journal=Nature Structural Biology | volume=9 | pages=646-652 | doi=10.1038/nsb0902-646}}&amp;lt;/ref&amp;gt; The potential between particles were calculated using pairwise-additive 12-6 Lennard-Jones potentials. All simulations were performed on the HPC system using the [http://lammps.sandia.gov LAMMPS software package].&lt;br /&gt;
&lt;br /&gt;
=== Velocity Verlet Algorithm ===&lt;br /&gt;
&lt;br /&gt;
To begin the simulation, a lattice of atoms can be initiated with atoms a user-defined length apart (inputted in reduced units). All particles were given an initial velocity (according to Maxwell-Boltzmann distribution). Integrating each particle&#039;s velocity over time iteratively gave the new positions of the atoms in the system. This was done using the velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
At first, the timestep of the simulation was varied to observe the errors in the positions with passing time when using the velocity-Verlet algorithm. This was done by calculating the exact position of a simple harmonic oscillator, and comparing against the position given by the velocity-Verlet calculation.&lt;br /&gt;
&lt;br /&gt;
For a simple harmonic oscillator, &amp;lt;math&amp;gt;x(t) = A \cos(\omega t + \phi)&amp;lt;/math&amp;gt;. Using an Excel spreadsheet, the error in the Velocity-Verlet algorithm was calculated. In this case, &amp;lt;math&amp;gt; A = \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. The error is plotted in Figure 1, and the maxima in the error is plotted against time in Figure 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=205px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:sho_error.PNG|Figure 1: Error in displacement (when calculated by velocity-Verlet algorithm) against time for a simple harmonic oscillator.&lt;br /&gt;
image:sho_max_error.PNG|Figure 2: Maximum error in displacement against time for the harmonic oscillator.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By changing the timestep in the spreadsheet, it was found that the error in &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; as calculated by the velocity-Verlet algorithm is less than &amp;lt;math&amp;gt;1%&amp;lt;/math&amp;gt; over the course of the simulation when the timestep is less than &amp;lt;math&amp;gt;0.025&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The total energy of the system should be monitored to make sure that the energy is conserved in the system, and to check if the system is in thermal equilibrium. If the total energy is not stable, then the thermodynamic values derived from the system will not be equilibrium values, and cannot be compared to other MD systems.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the total energy should be approximately constant to ensure that the simulations give physically meaningful results.  Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
In order to make the calculations easier, the LJ-potentials were given a &#039;cut-off&#039; distance - any atoms separated by a distance larger than this truncation distance will not be included in the LJ force calculations.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1 | journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=27-29}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &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;\phi \left ( r \right ) = 4 \left ( \frac{1}{r^{12}} - \frac{1}{r^6} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi \left ( r \right ) {d}r = 4 \left ( - \frac{1}{12r^{11}} + \frac{1}{6r^5} \right ) + c = \frac{2}{3r^5} - \frac{1}{3r^{11}} + c&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, when limits are introduced:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -2.07 \cdot 10^{-2}&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 = -6.81 \cdot 10^{-3}&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 = -2.74 \cdot 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above calculations, the force of attraction reduces very quickly when the distance from the Lennard-Jones centre is greater than &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;. Hence, truncation at such a distance will introduce only a very small error in the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are missing half of the maths questions - what is r0, the force at r0, req and the potential at req?  The integral is not correct, the integral of 1/(r^12) is -12/(r^11), not -1/(12 r^11).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
As it is very heavy computationally to simulate even millimole amounts in LAMMPS, Periodic Boundary Conditions (PBCs) are used to cut down the calculation times.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=24-27}}&amp;lt;/ref&amp;gt; The reason for this difficulty can be seen by considering the number of particles in a small volume of water.&lt;br /&gt;
&lt;br /&gt;
For example, 1 mL of water contains:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{18} \cdot 6.022 \cdot 10^{23} = 3.346 \cdot 10^{22}&amp;lt;/math&amp;gt; molecules.&lt;br /&gt;
&lt;br /&gt;
In most cases, the number of particles used will be between 10&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
10&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; water molecules take up a volume of: &amp;lt;math&amp;gt;\frac{10^4}{6.022 \cdot 10^{23}} \cdot 18 = 2.99 \cdot 10^{-19} \, mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PBCs allow for the relatively small number of particles in our simulation to act as though it&#039;s part of a bulk solution. To this end, the particles are simulated such that when moves off one edge of the box, it reappears on the opposite face with the same velocity. Hence, the number of particles in the box, N, is always conserved.&lt;br /&gt;
&lt;br /&gt;
For example, consider an atom at &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box with vertices at &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt;. If this atom moves by vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt; in a single timestep, then the final position of the particle will be: &lt;br /&gt;
&amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
Reduced units are used to make the numbers more manageable.&lt;br /&gt;
&lt;br /&gt;
For Argon, &amp;lt;math&amp;gt;\sigma = 0.34 \, nm&amp;lt;/math&amp;gt;. Given that the LJ-cutoff in reduced units is at &amp;lt;math&amp;gt;r^*=3.2&amp;lt;/math&amp;gt;, the cutoff in nanometers is: &amp;lt;math&amp;gt;r = r^* \, \sigma = 3.2 \cdot 0.34 = 1.088 \, nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Given &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
well depth, &amp;lt;math&amp;gt; \epsilon = 120 k_B = 1.66 \cdot 10^{-21} \, J = \frac{1.66 \cdot 10^{-21} \cdot N_A}{1000} kJ \, mol^{-1} = 9.98 \cdot 10^{-1} \, kJ \, mol^{-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, when &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;, and given &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = \frac{\epsilon}{k_B} \cdot T^* = 120 \cdot 1.5 = 180 \, K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculations correct.  PBCs are used to remove the effects of the edges of the simulation box and make simulations a small systems behave like a bulk systems.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibriation==&lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
The particles for the simulation were initiated in a simple cubic lattice structure. A random set of coordinates were not used. This was to avoid two atoms being generated too close together - this would lead to a very large potential, and cause the pair to split violently apart. This simulation would be unlikely to be a good representation of a real life scenario of a crystal melting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces make the simulation unstable and can cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this simulation, a lattice density of 0.8 was used (0.8 lattice points per unit volume). If a face-centred cubic (fcc) lattice had been used instead, with a lattice density of 1.2, then the side length of the cubic unit cell, &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, can be found thus:&lt;br /&gt;
&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;1.2 = \frac{4 \cdot 1000}{(10 \cdot a)^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a = \frac{\sqrt[3]{\frac{4000}{1.2}}}{10} = 1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.  How many more atoms would be created in an fcc lattice compared to a simple cubic lattice?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Properties of atoms===&lt;br /&gt;
&lt;br /&gt;
The reaction conditions such as the lattice density are passed into LAMMPS using text commands in the input file. Part of the commands are shown below:&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;
&amp;lt;code&amp;gt; mass&amp;lt;/code&amp;gt; defines the property of the atom that is being defined. &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; indicates the type of particle being defined; all particles in LAMMPS are given a type, in form of an integer number. For example, if considering a mixture with 2 types of atoms, then the particles in LAMMPS would be differentiated by having type &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and type &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; particles, and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; indicates the [http://http://lammps.sandia.gov/doc/mass.html  mass] of the particle in g mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&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 line defines the [http://lammps.sandia.gov/doc/pair_style.html potential between two interacting particles]. Once again, the &amp;lt;code&amp;gt;pair_style&amp;lt;/code&amp;gt; keyword indicates the property being defined. &amp;lt;code&amp;gt;lj/cut&amp;lt;/code&amp;gt; defines the potential as a truncated Lennard-Jones potential, while the &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; defines the potential to be truncated at &amp;lt;math&amp;gt;3.0 \, \sigma&amp;lt;/math&amp;gt;. Overall, the potential is being defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi \left ( r \right ) = 4 \epsilon \Bigg[ \left ( \frac{\sigma}{r} \right )^{12} - \left ( \frac{\sigma}{r} \right )^{6} \Bigg] \, \, \, \, \, \, \, \, \, \, \,  r &amp;lt; r_c &amp;lt;/math&amp;gt;&lt;br /&gt;
&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 line is defining the [http://lammps.sandia.gov/doc/pair_coeff.html force that each particle exerts] on all other particles is the same as that defined by the negative of the derivative of the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do the asterisks mean in this command and what do the number refer to for the Lennard-Jones potential?  Why is a cutoff used for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The generated particles are then given initial coordinates, and their initial velocities. As &amp;lt;math&amp;gt; x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are both specified, the velocity-Verlet integration is used for the simulations.&lt;br /&gt;
&lt;br /&gt;
===Running the Simulation===&lt;br /&gt;
&lt;br /&gt;
The final lines of the input file are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variable timestep equal 0.001 &amp;lt;/code&amp;gt; creates a variable so that any subsequent occurence of the string &amp;lt;code&amp;gt;${timestep}&amp;lt;/code&amp;gt; is replaced by &amp;lt;code&amp;gt;0.001&amp;lt;/code&amp;gt;. The number of steps the simulation is run for is also determined by the value of the timestep. By assigning a variable name to the timestep, editing the timestep value will automatically adjust the number of steps, avoiding tedious editing of the value in two different places each time the timestep is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables makes it easier to run different simulations with different valued parameters using the same script.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibriation===&lt;br /&gt;
&lt;br /&gt;
Several different simulations were run using different timesteps, and the total energy of the system was monitored at each step. Figure 3 shows the results of the simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvstime.jpg|center|frame|none|alt=Energy vs. Time|Figure 3: Energy vs. Time for differing timesteps]]&lt;br /&gt;
&lt;br /&gt;
All systems reach equilibrium, except for the system where the timestep is 0.015. The equilibrium was reached by around &amp;lt;math&amp;gt; time \approx 0.6&amp;lt;/math&amp;gt; - in quite a short amount of time.&lt;br /&gt;
&lt;br /&gt;
Of the five timesteps used, the largest acceptable timestep is 0.01. A particularly bad choice would be a timestep of 0.015. This is because the total energy of the system seems to be increasing indefinitely with increasing time with large fluctuations. This is a poor representation of a real system, hence this simulation timestep length is too long for this system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the choice of timestep so timesteps of 0.01 and 0.0075 are not suitable.  Both 0.0025 and 0.001 give roughly the same average total energy so the best choice would be the larger of these two (0.0025) to enable longer simulations to be run more efficiently.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==NPT Simulation==&lt;br /&gt;
&lt;br /&gt;
This section looks at running simulation under specific conditions, using an NPT ensemble. This is done using barostats and thermostats.&lt;br /&gt;
&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
Temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, fluctuates in the simulation, and the target temperature is &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. As temperature is related to the total kinetic energy of particles within the system, the temperature is kept roughly constant by multiplying the velocities of the particles by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. Hence, these two equations can be surmised from the above, from which an expression of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is derived:&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} &lt;br /&gt;
\implies \frac{1}{2} \gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2} \gamma^2 \cdot \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \gamma = \sqrt{\frac{2 \mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nearly, there shouldn&#039;t be a factor of 2 in the square root, check your working again.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===The Input Script===&lt;br /&gt;
&lt;br /&gt;
The thermodynamic property values of the system were periodically computed and saved to file using the following command in the input script:&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;
These values are [http://lammps.sandia.gov/doc/fix_ave_time.html time-averaged] in a specific way. The arguments &amp;lt;code&amp;gt;100 1000 100000&amp;lt;/code&amp;gt; instruct LAMMPS to compute the properties every 100000 steps using preceding 1000 values in intervals of 100 values. For example, at the 200000th step, the properties are averaged using values at steps number 100100, 100200, 100300... 199000, 200000.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations of a crystal melting were run at two different pressures, P = 2.5 and P = 3.0, with 8 temperatures for each pressure. A graph of density against temperature was then plotted, along with the density predicted by the Ideal Gas Law with respect to temperature at these two pressures. The results are shown in Figure 4. It can be seen that in general, the MD simulation predicts a lower density than the ideal gas law. This is because the ideal gas law does not take the forces between particles into account. In the Lennard-Jones potential model, the repulsive forces are very strong (compared to the attractive forces). Hence, the MD simulations show the particles will prefer to be more spread out (i.e. less dense) so as to minimise the unfavourable repulsive forces. The discrepancy decreases with increasing temperature, because the particles in the MD systems will move further apart. This in turn decreases the magnitude of the forces between particles, bringing it closer to the ideal system of no forces between particles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Pressure vs temperature.png|thumb|750px|center|none|alt=Density vs. Temperature|Figure 4: Density vs. Temperature for varying pressure as found by MD simulations, compared to results predicted by the Ideal Gas Law.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how does the discrepancy between the simulation and ideal gas results change with pressure?  The ideal gas is a good approximation to a dilute (high temperature, low pressure) gas.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
To investigate the effect of changing temperature on the heat capacity, a simulation was run in the NVT ensemble for two different densities (&amp;lt;math&amp;gt;\rho = 0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\rho = 0.8&amp;lt;/math&amp;gt;). The results of the simulations are summarised in Figure 5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Cv_v_vs_temp.png|thumb|750px|center|none|alt=Heat Capacity per Unit Volume vs. Reduced Temperature|Figure 5: Heat Capacity per Unit Volume vs. Reduced Temperature for differing lattice densities.]]&lt;br /&gt;
&lt;br /&gt;
The expected value for &amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; in an ideal system is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{3}{2} \cdot N \cdot \frac{1}{V} = \frac{3}{2} \cdot \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, for an ideal gas, when &amp;lt;math&amp;gt;\rho = 0.3, \, \frac{C_V}{V} = 0.1&amp;lt;/math&amp;gt; and when &amp;lt;math&amp;gt;\rho = 0.8, \, \frac{C_V}{V} = 1.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; found in the simulations are around 4 orders of magnitude smaller than what is predicted the ideal system, even at low densities (more ideal system). Also, the simulation shows variation of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; with increasing temperature (approximately &amp;lt;math&amp;gt;C_V \propto \frac{1}{T^n}, \, \, \, n &amp;lt; 2&amp;lt;/math&amp;gt;).&amp;lt;ref name=heat_capacity_data&amp;gt;{{cite journal | author1=Dinsdale, A.T. | year=1991 | title= SGTE data for pure elements| journal=CALPHAD | volume=15 | issue=4 | pages=317-425 | doi=|10.1016/0364-5916(91)90030-N}}&amp;lt;/ref&amp;gt; The value of n is unknown, and must be found by fitting different curves to the data. We know that &amp;lt;math&amp;gt;C_V \propto \frac{Var(E)}{T^2}&amp;lt;/math&amp;gt; and that &amp;lt;math&amp;gt;Var(E) \propto T^m, \, m &amp;gt; 0&amp;lt;/math&amp;gt;. Hence, we can estimate that &amp;lt;math&amp;gt;n = 2 - m \implies n &amp;lt; 2&amp;lt;/math&amp;gt;. This is in contrast to the ideal system, which predicts no variation of heat capacity with temperature. &lt;br /&gt;
&lt;br /&gt;
However, qualitatively, the trends seen are reasonable. As the temperature is raised, the particles have more and more energy, yet the number of available degrees of freedom fall. As &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; is a measure of how easily the system is excited to higher energy states - an already excited system requires even more energy to put the particles in a higher vibrational energy states. Increasing the number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;, also leads to a larger number of degrees of freedom, leading to an increase in the heat capacity, &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt;. Consequently, increasing &amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt; also leads to an increase in &amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt;. This trend is clearly seen in Figure 3.&lt;br /&gt;
&lt;br /&gt;
Finally, the apparent reversal in trends from &amp;lt;math&amp;gt;T^* = 2.3&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;T^* = 2.4&amp;lt;/math&amp;gt; is showing the change from a liquid to a gaseous phase.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Some good suggestions.  Why do you think the number of degrees of freedom reduces as energy is increased?  Remember these simulations are classical simulations of spherical particles, there are no vibrational energy levels.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===The Input Script===&lt;br /&gt;
&lt;br /&gt;
One of the scripts used for running the NVT simulations is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### CREATING VARIABLE TO DEFINE LATTICE DENSITY&lt;br /&gt;
variable rho equal 0.8&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${rho}&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.2&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;
### ENDING NVT ONCE SYSTEM IN REQUIRED STATE. NVE RESTATED.&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&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable eng equal etotal&lt;br /&gt;
variable eng2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_eng v_eng2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
&lt;br /&gt;
### CALCULATION OF C_V&lt;br /&gt;
variable vareng equal (f_aves[8]-f_aves[7]*f_aves[7])&lt;br /&gt;
variable cv equal (3375*3375*${vareng})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
### PRINTING CALCULATED VALUES TO OUTPUT FILE&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${cv}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF, or &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;) can provide some insight into the structure of the particles in the simulation. The three phases, solid, liquid and gas, have distinctive RDF plots. These RDF plots can be compared directly to X-Ray diffraction plots produced experimentally, so that the identity of the systems can be verified by this property.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=54-55}}&amp;lt;/ref&amp;gt; Figure 6 shows the RDF plots acquired by varying the density and temperature of the NVT simulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:RDF_allStates.png|Figure 6: The RDF of the same particles in solid, liquid and gaseous phase. The initial part of the graph where &amp;lt;math&amp;gt;RDF=0&amp;lt;/math&amp;gt; indicates space between adjacent particles. This figure also shows that &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; tends to &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes large.&lt;br /&gt;
image:RDF_integrated_allStates.png|Figure 7: The integral of the RDF of the same particles in solid, liquid and gaseous phase.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:fcc_lattice.png|left|frame|alt=3 closest neighbours of any atom on an fcc lattice.|Figure 8: Three closest neighbours of each atom on an face-centred lattice shown by vectors &#039;&#039;&#039;1&#039;&#039;&#039;, &#039;&#039;&#039;2&#039;&#039;&#039; and &#039;&#039;&#039;3&#039;&#039;&#039; in increasing order of magnitude.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen from Figure 6, from &amp;lt;math&amp;gt;\sigma=0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\sigma \approx 1 &amp;lt;/math&amp;gt; is where the repulsive forces between the adjacent atoms are too great to be overcome, and hence is empty space.&lt;br /&gt;
&lt;br /&gt;
The RDF of solids have sharp peaks at well defined spacing. The atoms responsible for each of the first three main peaks are outlined in Table 1 using Figure 8 as a reference. The lattice parameter is the distance between two adjacent atoms on the fcc lattice along a straight edge (i.e. not diagonally adjacent). This appears to be approximately &amp;lt;math&amp;gt;1.775 \sigma&amp;lt;/math&amp;gt;. The RDF decreases slowly as the radius increases.&lt;br /&gt;
&lt;br /&gt;
By using the plot of &amp;lt;math&amp;gt;\int g(r) \, \mathrm{d}V&amp;lt;/math&amp;gt; against &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; (see Figure 7), the coordination number around a single reference atom as the distance, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, increases. The coordination numbers at symmetry related lattice vectors &#039;&#039;&#039;1&#039;&#039;&#039;, &#039;&#039;&#039;2&#039;&#039;&#039; and &#039;&#039;&#039;3&#039;&#039;&#039; for this fcc lattice are tabulated in Table 1.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;&lt;br /&gt;
|+ Table 1: Summary of data inferred from RDF data.&lt;br /&gt;
! Vector !! Distance from central atom/&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1.025 || 8&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1.775 || 8&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 2.725 || 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid has a smooth RDF, with the peaks similar distances apart, but its decay is faster than that of the solid&#039;s. The progressively smaller peaks indicate the coordination shells around each atom. &lt;br /&gt;
&lt;br /&gt;
Finally, the RDF of the gas phase tends to 1 very quickly, with no visible oscillations about &amp;lt;math&amp;gt; g(r) = 1 &amp;lt;/math&amp;gt;. This indicates a uniform distribution of particles in the simulation box, as is expected of a gas in equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Solid has long range order, liquid only has short range order.  How did you calculate the lattice parameter, it should be roughly the distance to the second peak which is less than 1.775.  Could you have also calculated it from the first and third peaks and taken an average?  The coordination numbers for the first 3 peaks should be 12, 6 and 24, did you zoom in to the integral graph to get these values?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the Diffusion Coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Square Displacement (MSD)===&lt;br /&gt;
[[File: MSD illustration.PNG|left|thumb|200px|Figure 9: A particle moving from initial position &#039;&#039;&#039;r(0)&#039;&#039;&#039; at time &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to another position &#039;&#039;&#039;r(t)&#039;&#039;&#039; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
The motion of the particles in the molecular simulation were investigated by finding several properties of the systems.&lt;br /&gt;
&lt;br /&gt;
The [http://isaacs.sourceforge.net/phys/msd.html Mean Square Deviation (MSD)] of the system is a measure of how freely the particles in the system can move to a new position (see Figure 9). The MSD is calculated thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;MSD = [\mathbf{r(0)} - \mathbf{r(t)}]^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, as time progresses in a system with diffusion, the sum of MSD over all time intervals will be increasing. As &amp;lt;math&amp;gt;t \rightarrow \infty&amp;lt;/math&amp;gt;, the rate of increase of MSD is approximately constant. The diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \, \frac{\partial \langle \mathbf{r}^2\mathbf{(t)} \rangle }{\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation is true as &amp;lt;math&amp;gt;t \rightarrow \infty&amp;lt;/math&amp;gt;; at small values of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, there are few or no collisions, and the increase in &amp;lt;math&amp;gt;MSD \propto t^2&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can thus be estimated by fitting a straight line to the linear portion of a plot of &amp;lt;math&amp;gt;MSD&amp;lt;/math&amp;gt; against time. Figures 10, 11, 12 and 13 show the calculation of the diffusion coefficient from the &amp;lt;math&amp;gt;MSD&amp;lt;/math&amp;gt; plots. Table 2 records the values of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; - a clear trend of increasing values of diffusion coefficients with decreasing density can be seen from the data. Atoms in gases can therefore diffuse 20 times as fast as atoms in solids.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=360px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:allStates_MSD.png|Figure 10: The MSD of the particles at at all states. The values increases with relation to time - the fastest increase is for the gas phase, followed by the liquid phase, and the solid phase is the slowest.&lt;br /&gt;
image:Solid msd fitted.png|Figure 11: The MSD of the particles in the solid phase. As the particles&#039; movements are restricted and not averaged, the plot is not smooth.&lt;br /&gt;
image:liquid_msd_fitted.png|Figure 12: The MSD of the particles in the liquid phase. The plot is linear, indicating &amp;lt;math&amp;gt;MSD \propto t&amp;lt;/math&amp;gt;.&lt;br /&gt;
image:gas_msd_fitted.png|Figure 13: The MSD of the particles in the gas phase. Initially, &amp;lt;math&amp;gt;MSD \propto t^2&amp;lt;/math&amp;gt;, but as &amp;lt;math&amp;gt;t \rightarrow \inf, \, MSD \propto t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 2: Diffusion coefficient data for solid, liquid and gaseous states.&lt;br /&gt;
! State !! &amp;lt;math&amp;gt;\rho^*&amp;lt;/math&amp;gt; !! Diffusion Coefficients, &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Solid || 1.3 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.74 \cdot 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 0.8 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.47 \cdot 10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || 0.1 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;5.23 \cdot 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Would you expect the MSD to increase for a solid?  Did you remember to change the lattice type to fcc in the script?  Good explanation that MSD is proportional to t^2 at short times, this is especially clear in the gas phase plot.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above simulations were performed with thousands of particles, and this can be considered as a relatively small amount - not even a fraction of a femtomole of atoms. To simulate a larger system, a set of simulations were run with 1 million atoms. The difference in the MSD plots (see Figures 14, 15, 16 and 17) is most marked in the solid state - whereas in the smaller system, there was a definite increase in MSD over time for all timesteps, the larger system oscillates slowly oscillates around &amp;lt;math&amp;gt;MSD = 0.0066&amp;lt;/math&amp;gt;. Physically, this observation shows that most of the particles in the solid are vibrating and colliding into each other very often. In the smaller system, the collisions are much less frequent, so that &amp;lt;math&amp;gt;|\mathbf{r(0)} - \mathbf{r(t)}|&amp;lt;/math&amp;gt; is larger for each atom. The diffusion coefficients of the million atoms in the three states are tabulated in Table 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=360px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:msd_mill_allStates.png|Figure 14: The MSD of the 1 million particles at at all states.&lt;br /&gt;
image:msd_mill_sol.png|Figure 15: The MSD of the particles in the solid phase. This plot is jagged, and the gradient is almost &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;: indicating virtually no diffusion in solid state.&lt;br /&gt;
image:msd_mill_liq.png|Figure 16: The MSD of the particles in the liquid phase. The plot is linear from &amp;lt;math&amp;gt;t = 1000&amp;lt;/math&amp;gt;.&lt;br /&gt;
image:msd_mill_vap.png|Figure 17: The MSD of the particles in the gaseous phase. The plot is linear from &amp;lt;math&amp;gt;t = 3000&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 3: Diffusion coefficient data for 1 million atoms in solid, liquid and vapour states.&lt;br /&gt;
! State !! Diffusion Coefficients, &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Solid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.37 \cdot 10^{-8}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.50 \cdot 10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;1.25 \cdot 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Figure 15 is what you would expect for a solid phase.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, can also be estimated from the [http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html velocity autocorrelation function (VACF)], &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;C(\tau) \rightarrow 0&amp;lt;/math&amp;gt; at large &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=59-60}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \langle \mathbf{v(t)} \cdot \mathbf{v(t + \tau)} \rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3} \, \int_0^\infty \langle \mathbf{v(0)} \cdot \mathbf{v(\tau)} \rangle \, \mathrm{d} \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below, the normalised velocity autocorrelation function is evaluated for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
Given &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;x(t)=A \cos (\omega t + \phi) \implies v(t)=-A \omega \sin (\omega t + \phi)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega \sin (\omega t + \phi) A \omega \sin [\omega(t + \tau) + \phi)]\mathrm{d} t}{\int_{-\infty}^{\infty} A^2 \omega^2 \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} \sin (\omega t + \phi) \sin [\omega(t + \tau) + \phi)]\mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt;\sin(a + b) \equiv \sin(a) \cos(b) + \sin(b) \cos(a) &amp;lt;/math&amp;gt;, the following can be surmised:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin [\omega(t + \tau) + \phi)] = \sin(\omega t + \omega \tau + \phi) = \sin(\omega t + \phi) \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \cos(\omega \tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) + \sin(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi) \cos(\omega t + \phi) \mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging &amp;lt;math&amp;gt;\sin^2(x) \equiv \frac{ 1 - \cos(2x)}{2}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \int_{-\infty}^{\infty} \sin[2(\omega t + \phi)] \mathrm{d} t}{2\int_{-\infty}^{\infty} \frac{1 - \cos[2(\omega t + \phi)]}{2} \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \int_{-\infty}^{\infty} \sin[2(\omega t + \phi)] \mathrm{d} t}{\int_{-\infty}^{\infty} 1 - \cos[2(\omega t + \phi)] \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \cdot \frac{1}{2 \omega} \, [\cos(\infty) - \cos(-\infty)]}{\int_{-\infty}^{\infty} 1 - \cos[2(\omega t + \phi)] \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;\cos(-a) = \cos(a)&amp;lt;/math&amp;gt; as this is an even function.&lt;br /&gt;
&lt;br /&gt;
Thus, &amp;lt;math&amp;gt;\cos(\infty) - \cos(-\infty) = 0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C(\tau) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, the derivation could have been simplified by realising that the function sin(x)*cos(x) is an odd function and so the integral is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This result shows that for a simple harmonic oscillator, the VACF is a sinusoidal function that depends on the time passed, as well as the frequency of the oscillator. &lt;br /&gt;
&lt;br /&gt;
The VACF of the solid and liquid states were calculated during the simulations. In addition, the analytical solution to the VACF of a particle doing simple harmonic motion with frequency, &amp;lt;math&amp;gt;\omega = \frac{1}{2 \pi}&amp;lt;/math&amp;gt; was also calculated. These are all plotted in Figure 18. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:vacf_allStates.png|Figure 18: The plots of velocity autocorrelation functions with for atoms in a solid, a liquid, and for a simple harmonic oscillator. At large &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;C(\tau) \rightarrow 0&amp;lt;/math&amp;gt; for the solid and liquid systems.&lt;br /&gt;
image:vacf_gas.png|Figure 19: VACF of atoms in the gaseous phase decay much more slowly owing to the much weaker interatomic forces.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Figure 18, it can be observed that the VACF of the simple harmonic oscillator is sinusoidal, whereas the liquid and solid VACF are best described as damped sinusoidal. The solid&#039;s VACF tends to 0 faster that that of the liquid. &lt;br /&gt;
&lt;br /&gt;
The global minima in the plots for the solid and liquid indicate when all the particles have had at least one collision. By this point, each of the atoms have a different velocity vector associated with it. Hence, the VACF rebounds towards 0. As the simple harmonic oscillator is a lone particle&#039;s motion, with no interactions with any other atoms, hence its VACF is very different to the Lennard-Jones solid and liquid. Its velocity vector also changes in a cyclic manner, and does not change from one oscillation to another. Hence, the amplitude of the VACF does not change as time increases.&lt;br /&gt;
&lt;br /&gt;
In the solid, the particles are in close contact due to the high density - the atoms are arranged so that the repulsive forces are minimised, and the attractive forces maximised. This is the distance at which the LJ-potential is at a minimum. Here, the atoms are very stable, and are reluctant to leave the locations they are at.Their motion is therefore a vibration around their eqiulibrium positions, with a reversal of velocity at the end of each oscillation. This explains the oscillatory behaviour of the VACF. However, the damping is explained by perturbative forces acting on the atoms that disrupt the oscillations. Liquids are similar to solids - however, the density here is lower, and diffusion is faster. Here, the diffusive forces are the perturbative forces, and hence the VACF decays much more rapidly than the solid&#039;s VACF.&lt;br /&gt;
&lt;br /&gt;
In contrast, the VACF from a system in the gaseous state (see Figure 19) decays much more slowly. The large separation distances between particles in the gaseous phase mean the forces are weaker. Hence, the inter=particle forces between them only affect their velocities very slowly, over a long time. For this reason, the VACF decays much more slowly than the liquid and the solid VACF.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the perturbative forces in the solid?  Collisions between particles randomise particle velocities and cause the VACF to decorrelate, but there are no collisions in the harmonic oscillator.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:vacf_trapz.png|Figure 20: Cumulative integral of VACF against time for all phases as an approximation to the diffusion coefficient.&lt;br /&gt;
image:Vacf_trapz_liq_sol.png|Figure 21: Cumulative integral of VACF against time for solid and liquid phases.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The area under the VACF, and thus the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, was estimated by using the trapezium rule, by using the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3} \, \int_0^\infty \langle \mathbf{v(0)} \cdot \mathbf{v(\tau)} \rangle \, \mathrm{d} \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cumulative integral is plotted in Figures 18 and 19. The gas has a very large &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, compared to the liquid and the solid; the diffusion coefficient of the liquid is approximately 100 times as large as that of the solid. The trend of lower &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; with higher density is as found earlier in Tables 2 and 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:int_vacf_mill_allStates.png|Figure 22: Cumulative integral of VACF against time for all phases for 1 million atoms.&lt;br /&gt;
image:Int_vacf_mill_liq_sol.png|Figure 23: Cumulative integral of VACF against time for solid and liquid phases for 1 million atoms.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 4: Diffusion coefficient data derived from MSD and VACD compared for solid, liquid and gaseous states.&lt;br /&gt;
! State !! Diffusion Coefficients (MSD), &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; !! Diffusion Coefficients (VACD), &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.37 \cdot 10^{-8}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;0.0487&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.50 \cdot 10^{-4}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;15.1 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;1.25 \cdot 10^{-2}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;544&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A larger system with a million atoms was also simulated to simulate a system more akin to a real-life system. These plots (see Figures 22 and 23) are much smoother and give a more accurate value of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. The values of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; acquired for the 1 million atom simulation from the VACD is compared to that of the values acquired from the MSD in Table 4. The table shows &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; values gotten from the VACD values are much higher than those derived from the MSD values. The largest source of errors of calculation of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is from the use of trapezium rule to approximate the area under the graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculating D from the VACF relies on the integral of the VACF reaching a plateau within the simulation time, is this the case here?  Do you think the MSD or VACF derived values for the diffusion coefficient are more accurate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:P0TAT0&amp;diff=612358</id>
		<title>Talk:Mod:P0TAT0</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:P0TAT0&amp;diff=612358"/>
		<updated>2017-03-29T05:32:08Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered, but a few parts missing from some questions.  Some good explanations, but&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  = Molecular Dynamics...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered, but a few parts missing from some questions.  Some good explanations, but&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Molecular Dynamics Simulations of Simple Liquids =&lt;br /&gt;
[[User:Ab9314|Ab9314]] ([[User talk:Ab9314|talk]]) 11:11, 24 March 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics (MD) is a method to simulate the motion of many particles by numerically integrating Newton&#039;s Laws of Motion over time. The simulation can be conducted in an ensemble, e.g. NVT or NVE, by setting limits on temperatures and pressures (thermostatting and barostatting respectively).&amp;lt;ref name=sutmann&amp;gt;{{cite journal | author1=Godehard Suttman | year=2002 | title=Classical Molecular Dynamics| journal=NIC Series | volume=10 | ISBN=3-00-009057-6 | pages=211-254 | doi=|10.1016/0364-5916(91)90030-N}}&amp;gt;&amp;lt;/ref&amp;gt; MD can be used to simulate the behaviour of protein folding, lipid bilayers, and other biological systems, thereby making this a very practical and convenient way to experiment with complex systems.&amp;lt;ref name=biological_apps&amp;gt;{{cite journal | author1=Karplus, Martin | year=2002 | title=Molecular dynamics simulations of biomolecules| journal=Nature Structural Biology | volume=9 | pages=646-652 | doi=10.1038/nsb0902-646}}&amp;lt;/ref&amp;gt; The potential between particles were calculated using pairwise-additive 12-6 Lennard-Jones potentials. All simulations were performed on the HPC system using the [http://lammps.sandia.gov LAMMPS software package].&lt;br /&gt;
&lt;br /&gt;
=== Velocity Verlet Algorithm ===&lt;br /&gt;
&lt;br /&gt;
To begin the simulation, a lattice of atoms can be initiated with atoms a user-defined length apart (inputted in reduced units). All particles were given an initial velocity (according to Maxwell-Boltzmann distribution). Integrating each particle&#039;s velocity over time iteratively gave the new positions of the atoms in the system. This was done using the velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
At first, the timestep of the simulation was varied to observe the errors in the positions with passing time when using the velocity-Verlet algorithm. This was done by calculating the exact position of a simple harmonic oscillator, and comparing against the position given by the velocity-Verlet calculation.&lt;br /&gt;
&lt;br /&gt;
For a simple harmonic oscillator, &amp;lt;math&amp;gt;x(t) = A \cos(\omega t + \phi)&amp;lt;/math&amp;gt;. Using an Excel spreadsheet, the error in the Velocity-Verlet algorithm was calculated. In this case, &amp;lt;math&amp;gt; A = \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. The error is plotted in Figure 1, and the maxima in the error is plotted against time in Figure 2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=205px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:sho_error.PNG|Figure 1: Error in displacement (when calculated by velocity-Verlet algorithm) against time for a simple harmonic oscillator.&lt;br /&gt;
image:sho_max_error.PNG|Figure 2: Maximum error in displacement against time for the harmonic oscillator.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By changing the timestep in the spreadsheet, it was found that the error in &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; as calculated by the velocity-Verlet algorithm is less than &amp;lt;math&amp;gt;1%&amp;lt;/math&amp;gt; over the course of the simulation when the timestep is less than &amp;lt;math&amp;gt;0.025&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The total energy of the system should be monitored to make sure that the energy is conserved in the system, and to check if the system is in thermal equilibrium. If the total energy is not stable, then the thermodynamic values derived from the system will not be equilibrium values, and cannot be compared to other MD systems.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the total energy should be approximately constant to ensure that the simulations give physically meaningful results.  Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
In order to make the calculations easier, the LJ-potentials were given a &#039;cut-off&#039; distance - any atoms separated by a distance larger than this truncation distance will not be included in the LJ force calculations.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1 | journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=27-29}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &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;\phi \left ( r \right ) = 4 \left ( \frac{1}{r^{12}} - \frac{1}{r^6} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi \left ( r \right ) {d}r = 4 \left ( - \frac{1}{12r^{11}} + \frac{1}{6r^5} \right ) + c = \frac{2}{3r^5} - \frac{1}{3r^{11}} + c&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus, when limits are introduced:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -2.07 \cdot 10^{-2}&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 = -6.81 \cdot 10^{-3}&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 = -2.74 \cdot 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the above calculations, the force of attraction reduces very quickly when the distance from the Lennard-Jones centre is greater than &amp;lt;math&amp;gt;2\sigma&amp;lt;/math&amp;gt;. Hence, truncation at such a distance will introduce only a very small error in the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are missing half of the maths questions - what is r0, the force at r0, req and the potential at req?  The integral is not correct, the integral of 1/(r^12) is -12/(r^11), not -1/(12 r^11).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
As it is very heavy computationally to simulate even millimole amounts in LAMMPS, Periodic Boundary Conditions (PBCs) are used to cut down the calculation times.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=24-27}}&amp;lt;/ref&amp;gt; The reason for this difficulty can be seen by considering the number of particles in a small volume of water.&lt;br /&gt;
&lt;br /&gt;
For example, 1 mL of water contains:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{18} \cdot 6.022 \cdot 10^{23} = 3.346 \cdot 10^{22}&amp;lt;/math&amp;gt; molecules.&lt;br /&gt;
&lt;br /&gt;
In most cases, the number of particles used will be between 10&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; and 10&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
10&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; water molecules take up a volume of: &amp;lt;math&amp;gt;\frac{10^4}{6.022 \cdot 10^{23}} \cdot 18 = 2.99 \cdot 10^{-19} \, mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PBCs allow for the relatively small number of particles in our simulation to act as though it&#039;s part of a bulk solution. To this end, the particles are simulated such that when moves off one edge of the box, it reappears on the opposite face with the same velocity. Hence, the number of particles in the box, N, is always conserved.&lt;br /&gt;
&lt;br /&gt;
For example, consider an atom at &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cubic box with vertices at &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt;. If this atom moves by vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt; in a single timestep, then the final position of the particle will be: &lt;br /&gt;
&amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
Reduced units are used to make the numbers more manageable.&lt;br /&gt;
&lt;br /&gt;
For Argon, &amp;lt;math&amp;gt;\sigma = 0.34 \, nm&amp;lt;/math&amp;gt;. Given that the LJ-cutoff in reduced units is at &amp;lt;math&amp;gt;r^*=3.2&amp;lt;/math&amp;gt;, the cutoff in nanometers is: &amp;lt;math&amp;gt;r = r^* \, \sigma = 3.2 \cdot 0.34 = 1.088 \, nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Given &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
well depth, &amp;lt;math&amp;gt; \epsilon = 120 k_B = 1.66 \cdot 10^{-21} \, J = \frac{1.66 \cdot 10^{-21} \cdot N_A}{1000} kJ \, mol^{-1} = 9.98 \cdot 10^{-1} \, kJ \, mol^{-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, when &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;, and given &amp;lt;math&amp;gt;\frac{\epsilon}{k_B} = 120&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = \frac{\epsilon}{k_B} \cdot T^* = 120 \cdot 1.5 = 180 \, K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculations correct.  PBCs are used to remove the effects of the edges of the simulation box and make simulations a small systems behave like a bulk systems.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibriation==&lt;br /&gt;
&lt;br /&gt;
===The Simulation Box===&lt;br /&gt;
&lt;br /&gt;
The particles for the simulation were initiated in a simple cubic lattice structure. A random set of coordinates were not used. This was to avoid two atoms being generated too close together - this would lead to a very large potential, and cause the pair to split violently apart. This simulation would be unlikely to be a good representation of a real life scenario of a crystal melting.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces make the simulation unstable and can cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this simulation, a lattice density of 0.8 was used (0.8 lattice points per unit volume). If a face-centred cubic (fcc) lattice had been used instead, with a lattice density of 1.2, then the side length of the cubic unit cell, &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;, can be found thus:&lt;br /&gt;
&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;1.2 = \frac{4 \cdot 1000}{(10 \cdot a)^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a = \frac{\sqrt[3]{\frac{4000}{1.2}}}{10} = 1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.  How many more atoms would be created in an fcc lattice compared to a simple cubic lattice?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Properties of atoms===&lt;br /&gt;
&lt;br /&gt;
The reaction conditions such as the lattice density are passed into LAMMPS using text commands in the input file. Part of the commands are shown below:&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;
&amp;lt;code&amp;gt; mass&amp;lt;/code&amp;gt; defines the property of the atom that is being defined. &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; indicates the type of particle being defined; all particles in LAMMPS are given a type, in form of an integer number. For example, if considering a mixture with 2 types of atoms, then the particles in LAMMPS would be differentiated by having type &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and type &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; particles, and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; indicates the [http://http://lammps.sandia.gov/doc/mass.html  mass] of the particle in g mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&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 line defines the [http://lammps.sandia.gov/doc/pair_style.html potential between two interacting particles]. Once again, the &amp;lt;code&amp;gt;pair_style&amp;lt;/code&amp;gt; keyword indicates the property being defined. &amp;lt;code&amp;gt;lj/cut&amp;lt;/code&amp;gt; defines the potential as a truncated Lennard-Jones potential, while the &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt; defines the potential to be truncated at &amp;lt;math&amp;gt;3.0 \, \sigma&amp;lt;/math&amp;gt;. Overall, the potential is being defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi \left ( r \right ) = 4 \epsilon \Bigg[ \left ( \frac{\sigma}{r} \right )^{12} - \left ( \frac{\sigma}{r} \right )^{6} \Bigg] \, \, \, \, \, \, \, \, \, \, \,  r &amp;lt; r_c &amp;lt;/math&amp;gt;&lt;br /&gt;
&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 line is defining the [http://lammps.sandia.gov/doc/pair_coeff.html force that each particle exerts] on all other particles is the same as that defined by the negative of the derivative of the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do the asterisks mean in this command and what do the number refer to for the Lennard-Jones potential?  Why is a cutoff used for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The generated particles are then given initial coordinates, and their initial velocities. As &amp;lt;math&amp;gt; x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are both specified, the velocity-Verlet integration is used for the simulations.&lt;br /&gt;
&lt;br /&gt;
===Running the Simulation===&lt;br /&gt;
&lt;br /&gt;
The final lines of the input file are as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;variable timestep equal 0.001 &amp;lt;/code&amp;gt; creates a variable so that any subsequent occurence of the string &amp;lt;code&amp;gt;${timestep}&amp;lt;/code&amp;gt; is replaced by &amp;lt;code&amp;gt;0.001&amp;lt;/code&amp;gt;. The number of steps the simulation is run for is also determined by the value of the timestep. By assigning a variable name to the timestep, editing the timestep value will automatically adjust the number of steps, avoiding tedious editing of the value in two different places each time the timestep is changed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables makes it easier to run different simulations with different valued parameters using the same script.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibriation===&lt;br /&gt;
&lt;br /&gt;
Several different simulations were run using different timesteps, and the total energy of the system was monitored at each step. Figure 3 shows the results of the simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvstime.jpg|center|frame|none|alt=Energy vs. Time|Figure 3: Energy vs. Time for differing timesteps]]&lt;br /&gt;
&lt;br /&gt;
All systems reach equilibrium, except for the system where the timestep is 0.015. The equilibrium was reached by around &amp;lt;math&amp;gt; time \approx 0.6&amp;lt;/math&amp;gt; - in quite a short amount of time.&lt;br /&gt;
&lt;br /&gt;
Of the five timesteps used, the largest acceptable timestep is 0.01. A particularly bad choice would be a timestep of 0.015. This is because the total energy of the system seems to be increasing indefinitely with increasing time with large fluctuations. This is a poor representation of a real system, hence this simulation timestep length is too long for this system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the choice of timestep so timesteps of 0.01 and 0.0075 are not suitable.  Both 0.0025 and 0.001 give roughly the same average total energy so the best choice would be the larger of these two (0.0025) to enable longer simulations to be run more efficiently.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==NPT Simulation==&lt;br /&gt;
&lt;br /&gt;
This section looks at running simulation under specific conditions, using an NPT ensemble. This is done using barostats and thermostats.&lt;br /&gt;
&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
Temperature, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;, fluctuates in the simulation, and the target temperature is &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. As temperature is related to the total kinetic energy of particles within the system, the temperature is kept roughly constant by multiplying the velocities of the particles by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. Hence, these two equations can be surmised from the above, from which an expression of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is derived:&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} &lt;br /&gt;
\implies \frac{1}{2} \gamma^2 \sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2} \gamma^2 \cdot \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \gamma = \sqrt{\frac{2 \mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nearly, there shouldn&#039;t be a factor of 2 in the square root, check your working again.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===The Input Script===&lt;br /&gt;
&lt;br /&gt;
The thermodynamic property values of the system were periodically computed and saved to file using the following command in the input script:&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;
These values are [http://lammps.sandia.gov/doc/fix_ave_time.html time-averaged] in a specific way. The arguments &amp;lt;code&amp;gt;100 1000 100000&amp;lt;/code&amp;gt; instruct LAMMPS to compute the properties every 100000 steps using preceding 1000 values in intervals of 100 values. For example, at the 200000th step, the properties are averaged using values at steps number 100100, 100200, 100300... 199000, 200000.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
Simulations of a crystal melting were run at two different pressures, P = 2.5 and P = 3.0, with 8 temperatures for each pressure. A graph of density against temperature was then plotted, along with the density predicted by the Ideal Gas Law with respect to temperature at these two pressures. The results are shown in Figure 4. It can be seen that in general, the MD simulation predicts a lower density than the ideal gas law. This is because the ideal gas law does not take the forces between particles into account. In the Lennard-Jones potential model, the repulsive forces are very strong (compared to the attractive forces). Hence, the MD simulations show the particles will prefer to be more spread out (i.e. less dense) so as to minimise the unfavourable repulsive forces. The discrepancy decreases with increasing temperature, because the particles in the MD systems will move further apart. This in turn decreases the magnitude of the forces between particles, bringing it closer to the ideal system of no forces between particles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Pressure vs temperature.png|thumb|750px|center|none|alt=Density vs. Temperature|Figure 4: Density vs. Temperature for varying pressure as found by MD simulations, compared to results predicted by the Ideal Gas Law.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how does the discrepancy between the simulation and ideal gas results change with pressure?  The ideal gas is a good approximation to a dilute (high temperature, low pressure) gas.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
To investigate the effect of changing temperature on the heat capacity, a simulation was run in the NVT ensemble for two different densities (&amp;lt;math&amp;gt;\rho = 0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\rho = 0.8&amp;lt;/math&amp;gt;). The results of the simulations are summarised in Figure 5.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Cv_v_vs_temp.png|thumb|750px|center|none|alt=Heat Capacity per Unit Volume vs. Reduced Temperature|Figure 5: Heat Capacity per Unit Volume vs. Reduced Temperature for differing lattice densities.]]&lt;br /&gt;
&lt;br /&gt;
The expected value for &amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; in an ideal system is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V} = \frac{3}{2} \cdot N \cdot \frac{1}{V} = \frac{3}{2} \cdot \rho&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, for an ideal gas, when &amp;lt;math&amp;gt;\rho = 0.3, \, \frac{C_V}{V} = 0.1&amp;lt;/math&amp;gt; and when &amp;lt;math&amp;gt;\rho = 0.8, \, \frac{C_V}{V} = 1.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; found in the simulations are around 4 orders of magnitude smaller than what is predicted the ideal system, even at low densities (more ideal system). Also, the simulation shows variation of &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; with increasing temperature (approximately &amp;lt;math&amp;gt;C_V \propto \frac{1}{T^n}, \, \, \, n &amp;lt; 2&amp;lt;/math&amp;gt;).&amp;lt;ref name=heat_capacity_data&amp;gt;{{cite journal | author1=Dinsdale, A.T. | year=1991 | title= SGTE data for pure elements| journal=CALPHAD | volume=15 | issue=4 | pages=317-425 | doi=|10.1016/0364-5916(91)90030-N}}&amp;lt;/ref&amp;gt; The value of n is unknown, and must be found by fitting different curves to the data. We know that &amp;lt;math&amp;gt;C_V \propto \frac{Var(E)}{T^2}&amp;lt;/math&amp;gt; and that &amp;lt;math&amp;gt;Var(E) \propto T^m, \, m &amp;gt; 0&amp;lt;/math&amp;gt;. Hence, we can estimate that &amp;lt;math&amp;gt;n = 2 - m \implies n &amp;lt; 2&amp;lt;/math&amp;gt;. This is in contrast to the ideal system, which predicts no variation of heat capacity with temperature. &lt;br /&gt;
&lt;br /&gt;
However, qualitatively, the trends seen are reasonable. As the temperature is raised, the particles have more and more energy, yet the number of available degrees of freedom fall. As &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; is a measure of how easily the system is excited to higher energy states - an already excited system requires even more energy to put the particles in a higher vibrational energy states. Increasing the number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;, also leads to a larger number of degrees of freedom, leading to an increase in the heat capacity, &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt;. Consequently, increasing &amp;lt;math&amp;gt;\rho = \frac{N}{V}&amp;lt;/math&amp;gt; also leads to an increase in &amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt;. This trend is clearly seen in Figure 3.&lt;br /&gt;
&lt;br /&gt;
Finally, the apparent reversal in trends from &amp;lt;math&amp;gt;T^* = 2.3&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;T^* = 2.4&amp;lt;/math&amp;gt; is showing the change from a liquid to a gaseous phase.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Some good suggestions.  Why do you think the number of degrees of freedom reduces as energy is increased?  Remember these simulations are classical simulations of spherical particles, there are no vibrational energy levels.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===The Input Script===&lt;br /&gt;
&lt;br /&gt;
One of the scripts used for running the NVT simulations is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### CREATING VARIABLE TO DEFINE LATTICE DENSITY&lt;br /&gt;
variable rho equal 0.8&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${rho}&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.2&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;
### ENDING NVT ONCE SYSTEM IN REQUIRED STATE. NVE RESTATED.&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&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable eng equal etotal&lt;br /&gt;
variable eng2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_eng v_eng2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
&lt;br /&gt;
### CALCULATION OF C_V&lt;br /&gt;
variable vareng equal (f_aves[8]-f_aves[7]*f_aves[7])&lt;br /&gt;
variable cv equal (3375*3375*${vareng})/(${avetemp}*${avetemp})&lt;br /&gt;
&lt;br /&gt;
### PRINTING CALCULATED VALUES TO OUTPUT FILE&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${cv}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
The Radial Distribution Function (RDF, or &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;) can provide some insight into the structure of the particles in the simulation. The three phases, solid, liquid and gas, have distinctive RDF plots. These RDF plots can be compared directly to X-Ray diffraction plots produced experimentally, so that the identity of the systems can be verified by this property.&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=54-55}}&amp;lt;/ref&amp;gt; Figure 6 shows the RDF plots acquired by varying the density and temperature of the NVT simulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:RDF_allStates.png|Figure 6: The RDF of the same particles in solid, liquid and gaseous phase. The initial part of the graph where &amp;lt;math&amp;gt;RDF=0&amp;lt;/math&amp;gt; indicates space between adjacent particles. This figure also shows that &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; tends to &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; becomes large.&lt;br /&gt;
image:RDF_integrated_allStates.png|Figure 7: The integral of the RDF of the same particles in solid, liquid and gaseous phase.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:fcc_lattice.png|left|frame|alt=3 closest neighbours of any atom on an fcc lattice.|Figure 8: Three closest neighbours of each atom on an face-centred lattice shown by vectors &#039;&#039;&#039;1&#039;&#039;&#039;, &#039;&#039;&#039;2&#039;&#039;&#039; and &#039;&#039;&#039;3&#039;&#039;&#039; in increasing order of magnitude.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen from Figure 6, from &amp;lt;math&amp;gt;\sigma=0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\sigma \approx 1 &amp;lt;/math&amp;gt; is where the repulsive forces between the adjacent atoms are too great to be overcome, and hence is empty space.&lt;br /&gt;
&lt;br /&gt;
The RDF of solids have sharp peaks at well defined spacing. The atoms responsible for each of the first three main peaks are outlined in Table 1 using Figure 8 as a reference. The lattice parameter is the distance between two adjacent atoms on the fcc lattice along a straight edge (i.e. not diagonally adjacent). This appears to be approximately &amp;lt;math&amp;gt;1.775 \sigma&amp;lt;/math&amp;gt;. The RDF decreases slowly as the radius increases.&lt;br /&gt;
&lt;br /&gt;
By using the plot of &amp;lt;math&amp;gt;\int g(r) \, \mathrm{d}V&amp;lt;/math&amp;gt; against &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; (see Figure 7), the coordination number around a single reference atom as the distance, &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;, increases. The coordination numbers at symmetry related lattice vectors &#039;&#039;&#039;1&#039;&#039;&#039;, &#039;&#039;&#039;2&#039;&#039;&#039; and &#039;&#039;&#039;3&#039;&#039;&#039; for this fcc lattice are tabulated in Table 1.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;&lt;br /&gt;
|+ Table 1: Summary of data inferred from RDF data.&lt;br /&gt;
! Vector !! Distance from central atom/&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; !! Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 1.025 || 8&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 1.775 || 8&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 2.725 || 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid has a smooth RDF, with the peaks similar distances apart, but its decay is faster than that of the solid&#039;s. The progressively smaller peaks indicate the coordination shells around each atom. &lt;br /&gt;
&lt;br /&gt;
Finally, the RDF of the gas phase tends to 1 very quickly, with no visible oscillations about &amp;lt;math&amp;gt; g(r) = 1 &amp;lt;/math&amp;gt;. This indicates a uniform distribution of particles in the simulation box, as is expected of a gas in equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Solid has long range order, liquid only has short range order.  How did you calculate the lattice parameter, it should be roughly the distance to the second peak which is less than 1.775.  Could you have also calculated it from the first and third peaks and taken an average?  The coordination numbers for the first 3 peaks should be 12, 6 and 24, did you zoom in to the integral graph to get these values?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the Diffusion Coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Square Displacement (MSD)===&lt;br /&gt;
[[File: MSD illustration.PNG|left|thumb|200px|Figure 9: A particle moving from initial position &#039;&#039;&#039;r(0)&#039;&#039;&#039; at time &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to another position &#039;&#039;&#039;r(t)&#039;&#039;&#039; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
The motion of the particles in the molecular simulation were investigated by finding several properties of the systems.&lt;br /&gt;
&lt;br /&gt;
The [http://isaacs.sourceforge.net/phys/msd.html Mean Square Deviation (MSD)] of the system is a measure of how freely the particles in the system can move to a new position (see Figure 9). The MSD is calculated thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;MSD = [\mathbf{r(0)} - \mathbf{r(t)}]^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence, as time progresses in a system with diffusion, the sum of MSD over all time intervals will be increasing. As &amp;lt;math&amp;gt;t \rightarrow \infty&amp;lt;/math&amp;gt;, the rate of increase of MSD is approximately constant. The diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \, \frac{\partial \langle \mathbf{r}^2\mathbf{(t)} \rangle }{\partial t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation is true as &amp;lt;math&amp;gt;t \rightarrow \infty&amp;lt;/math&amp;gt;; at small values of &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, there are few or no collisions, and the increase in &amp;lt;math&amp;gt;MSD \propto t^2&amp;lt;/math&amp;gt;. &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can thus be estimated by fitting a straight line to the linear portion of a plot of &amp;lt;math&amp;gt;MSD&amp;lt;/math&amp;gt; against time. Figures 10, 11, 12 and 13 show the calculation of the diffusion coefficient from the &amp;lt;math&amp;gt;MSD&amp;lt;/math&amp;gt; plots. Table 2 records the values of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; - a clear trend of increasing values of diffusion coefficients with decreasing density can be seen from the data. Atoms in gases can therefore diffuse 20 times as fast as atoms in solids.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=360px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:allStates_MSD.png|Figure 10: The MSD of the particles at at all states. The values increases with relation to time - the fastest increase is for the gas phase, followed by the liquid phase, and the solid phase is the slowest.&lt;br /&gt;
image:Solid msd fitted.png|Figure 11: The MSD of the particles in the solid phase. As the particles&#039; movements are restricted and not averaged, the plot is not smooth.&lt;br /&gt;
image:liquid_msd_fitted.png|Figure 12: The MSD of the particles in the liquid phase. The plot is linear, indicating &amp;lt;math&amp;gt;MSD \propto t&amp;lt;/math&amp;gt;.&lt;br /&gt;
image:gas_msd_fitted.png|Figure 13: The MSD of the particles in the gas phase. Initially, &amp;lt;math&amp;gt;MSD \propto t^2&amp;lt;/math&amp;gt;, but as &amp;lt;math&amp;gt;t \rightarrow \inf, \, MSD \propto t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 2: Diffusion coefficient data for solid, liquid and gaseous states.&lt;br /&gt;
! State !! &amp;lt;math&amp;gt;\rho^*&amp;lt;/math&amp;gt; !! Diffusion Coefficients, &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Solid || 1.3 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.74 \cdot 10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 0.8 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.47 \cdot 10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || 0.1 || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;5.23 \cdot 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Would you expect the MSD to increase for a solid?  Did you remember to change the lattice type to fcc in the script?  Good explanation that MSD is proportional to t^2 at short times, this is especially clear in the gas phase plot.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The above simulations were performed with thousands of particles, and this can be considered as a relatively small amount - not even a fraction of a femtomole of atoms. To simulate a larger system, a set of simulations were run with 1 million atoms. The difference in the MSD plots (see Figures 14, 15, 16 and 17) is most marked in the solid state - whereas in the smaller system, there was a definite increase in MSD over time for all timesteps, the larger system oscillates slowly oscillates around &amp;lt;math&amp;gt;MSD = 0.0066&amp;lt;/math&amp;gt;. Physically, this observation shows that most of the particles in the solid are vibrating and colliding into each other very often. In the smaller system, the collisions are much less frequent, so that &amp;lt;math&amp;gt;|\mathbf{r(0)} - \mathbf{r(t)}|&amp;lt;/math&amp;gt; is larger for each atom. The diffusion coefficients of the million atoms in the three states are tabulated in Table 3.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=360px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:msd_mill_allStates.png|Figure 14: The MSD of the 1 million particles at at all states.&lt;br /&gt;
image:msd_mill_sol.png|Figure 15: The MSD of the particles in the solid phase. This plot is jagged, and the gradient is almost &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;: indicating virtually no diffusion in solid state.&lt;br /&gt;
image:msd_mill_liq.png|Figure 16: The MSD of the particles in the liquid phase. The plot is linear from &amp;lt;math&amp;gt;t = 1000&amp;lt;/math&amp;gt;.&lt;br /&gt;
image:msd_mill_vap.png|Figure 17: The MSD of the particles in the gaseous phase. The plot is linear from &amp;lt;math&amp;gt;t = 3000&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 3: Diffusion coefficient data for 1 million atoms in solid, liquid and vapour states.&lt;br /&gt;
! State !! Diffusion Coefficients, &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Solid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.37 \cdot 10^{-8}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.50 \cdot 10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;1.25 \cdot 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Figure 15 is what you would expect for a solid phase.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, can also be estimated from the [http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html velocity autocorrelation function (VACF)], &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt;, if &amp;lt;math&amp;gt;C(\tau) \rightarrow 0&amp;lt;/math&amp;gt; at large &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;&amp;lt;ref name=RDF&amp;gt;{{cite journal | author1=Allen, M.P. | author2=Tildesley, D.J. | year=1987 | title=Computer Simulation of Liquids | volume=1| journal=Oxford: Clarenden Press | ISBN=0-19-855375-7 | pages=59-60}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \langle \mathbf{v(t)} \cdot \mathbf{v(t + \tau)} \rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3} \, \int_0^\infty \langle \mathbf{v(0)} \cdot \mathbf{v(\tau)} \rangle \, \mathrm{d} \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below, the normalised velocity autocorrelation function is evaluated for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
Given &amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;x(t)=A \cos (\omega t + \phi) \implies v(t)=-A \omega \sin (\omega t + \phi)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega \sin (\omega t + \phi) A \omega \sin [\omega(t + \tau) + \phi)]\mathrm{d} t}{\int_{-\infty}^{\infty} A^2 \omega^2 \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} \sin (\omega t + \phi) \sin [\omega(t + \tau) + \phi)]\mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt;\sin(a + b) \equiv \sin(a) \cos(b) + \sin(b) \cos(a) &amp;lt;/math&amp;gt;, the following can be surmised:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin [\omega(t + \tau) + \phi)] = \sin(\omega t + \omega \tau + \phi) = \sin(\omega t + \phi) \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \cos(\omega \tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) + \sin(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi) \cos(\omega t + \phi) \mathrm{d} t}{\int_{-\infty}^{\infty} \sin^2 (\omega t + \phi) \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearranging &amp;lt;math&amp;gt;\sin^2(x) \equiv \frac{ 1 - \cos(2x)}{2}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \int_{-\infty}^{\infty} \sin[2(\omega t + \phi)] \mathrm{d} t}{2\int_{-\infty}^{\infty} \frac{1 - \cos[2(\omega t + \phi)]}{2} \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simplifying,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \int_{-\infty}^{\infty} \sin[2(\omega t + \phi)] \mathrm{d} t}{\int_{-\infty}^{\infty} 1 - \cos[2(\omega t + \phi)] \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \frac{\sin(\omega \tau) \cdot \frac{1}{2 \omega} \, [\cos(\infty) - \cos(-\infty)]}{\int_{-\infty}^{\infty} 1 - \cos[2(\omega t + \phi)] \mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, &amp;lt;math&amp;gt;\cos(-a) = \cos(a)&amp;lt;/math&amp;gt; as this is an even function.&lt;br /&gt;
&lt;br /&gt;
Thus, &amp;lt;math&amp;gt;\cos(\infty) - \cos(-\infty) = 0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C(\tau) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, the derivation could have been simplified by realising that the function sin(x)*cos(x) is an odd function and so the integral is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This result shows that for a simple harmonic oscillator, the VACF is a sinusoidal function that depends on the time passed, as well as the frequency of the oscillator. &lt;br /&gt;
&lt;br /&gt;
The VACF of the solid and liquid states were calculated during the simulations. In addition, the analytical solution to the VACF of a particle doing simple harmonic motion with frequency, &amp;lt;math&amp;gt;\omega = \frac{1}{2 \pi}&amp;lt;/math&amp;gt; was also calculated. These are all plotted in Figure 18. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:vacf_allStates.png|Figure 18: The plots of velocity autocorrelation functions with for atoms in a solid, a liquid, and for a simple harmonic oscillator. At large &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;C(\tau) \rightarrow 0&amp;lt;/math&amp;gt; for the solid and liquid systems.&lt;br /&gt;
image:vacf_gas.png|Figure 19: VACF of atoms in the gaseous phase decay much more slowly owing to the much weaker interatomic forces.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Figure 18, it can be observed that the VACF of the simple harmonic oscillator is sinusoidal, whereas the liquid and solid VACF are best described as damped sinusoidal. The solid&#039;s VACF tends to 0 faster that that of the liquid. &lt;br /&gt;
&lt;br /&gt;
The global minima in the plots for the solid and liquid indicate when all the particles have had at least one collision. By this point, each of the atoms have a different velocity vector associated with it. Hence, the VACF rebounds towards 0. As the simple harmonic oscillator is a lone particle&#039;s motion, with no interactions with any other atoms, hence its VACF is very different to the Lennard-Jones solid and liquid. Its velocity vector also changes in a cyclic manner, and does not change from one oscillation to another. Hence, the amplitude of the VACF does not change as time increases.&lt;br /&gt;
&lt;br /&gt;
In the solid, the particles are in close contact due to the high density - the atoms are arranged so that the repulsive forces are minimised, and the attractive forces maximised. This is the distance at which the LJ-potential is at a minimum. Here, the atoms are very stable, and are reluctant to leave the locations they are at.Their motion is therefore a vibration around their eqiulibrium positions, with a reversal of velocity at the end of each oscillation. This explains the oscillatory behaviour of the VACF. However, the damping is explained by perturbative forces acting on the atoms that disrupt the oscillations. Liquids are similar to solids - however, the density here is lower, and diffusion is faster. Here, the diffusive forces are the perturbative forces, and hence the VACF decays much more rapidly than the solid&#039;s VACF.&lt;br /&gt;
&lt;br /&gt;
In contrast, the VACF from a system in the gaseous state (see Figure 19) decays much more slowly. The large separation distances between particles in the gaseous phase mean the forces are weaker. Hence, the inter=particle forces between them only affect their velocities very slowly, over a long time. For this reason, the VACF decays much more slowly than the liquid and the solid VACF.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC:  What are the perturbative forces.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:vacf_trapz.png|Figure 20: Cumulative integral of VACF against time for all phases as an approximation to the diffusion coefficient.&lt;br /&gt;
image:Vacf_trapz_liq_sol.png|Figure 21: Cumulative integral of VACF against time for solid and liquid phases.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The area under the VACF, and thus the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, was estimated by using the trapezium rule, by using the following formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3} \, \int_0^\infty \langle \mathbf{v(0)} \cdot \mathbf{v(\tau)} \rangle \, \mathrm{d} \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cumulative integral is plotted in Figures 18 and 19. The gas has a very large &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, compared to the liquid and the solid; the diffusion coefficient of the liquid is approximately 100 times as large as that of the solid. The trend of lower &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; with higher density is as found earlier in Tables 2 and 3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed heights=395px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
image:int_vacf_mill_allStates.png|Figure 22: Cumulative integral of VACF against time for all phases for 1 million atoms.&lt;br /&gt;
image:Int_vacf_mill_liq_sol.png|Figure 23: Cumulative integral of VACF against time for solid and liquid phases for 1 million atoms.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: 20px;&amp;quot;1&lt;br /&gt;
|+ Table 4: Diffusion coefficient data derived from MSD and VACD compared for solid, liquid and gaseous states.&lt;br /&gt;
! State !! Diffusion Coefficients (MSD), &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt; !! Diffusion Coefficients (VACD), &amp;lt;math&amp;gt;D/\sigma^2 \, timestep^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Solid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;2.37 \cdot 10^{-8}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;0.0487&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;3.50 \cdot 10^{-4}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;15.1 &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;1.25 \cdot 10^{-2}&amp;lt;/math&amp;gt; || style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math&amp;gt;544&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A larger system with a million atoms was also simulated to simulate a system more akin to a real-life system. These plots (see Figures 22 and 23) are much smoother and give a more accurate value of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. The values of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; acquired for the 1 million atom simulation from the VACD is compared to that of the values acquired from the MSD in Table 4. The table shows &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; values gotten from the VACD values are much higher than those derived from the MSD values. The largest source of errors of calculation of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; from VACF is from the use of trapezium rule to approximate the area under the graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculating D from the VACF relies on the integral of the VACF reaching a plateau within the simulation time, is this the case here?  Do you think the MSD or VACF derived values for the diffusion coefficient are more accurate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:LISIMSns2214&amp;diff=612357</id>
		<title>Talk:Mod:LISIMSns2214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:LISIMSns2214&amp;diff=612357"/>
		<updated>2017-03-28T21:34:13Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks completed with some good answers, but some explanations are a bit unclear.  Make sure you understand the background...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks completed with some good answers, but some explanations are a bit unclear.  Make sure you understand the background theory behind each task and behind the results that you obtain so that you fully explain what the results are showing.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;big&amp;gt;Simulation of Simple Liquids&amp;lt;/big&amp;gt;=&lt;br /&gt;
==Introduction==&lt;br /&gt;
Molecular dynamics simulations simplifies measuring properties of a material and constructing further calculations.  A computer is able to calculate these properties by taking into account the individual atomic environments within the material. This can be vastly complicated with even the most simple liquid systems, but HPC (High Performance Computing) can analyse complex structures and dynamics such as protein folding. &lt;br /&gt;
&lt;br /&gt;
Visual Molecular Dynamics (VMD) was used to collate and visualise the trajectory files created by Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) software. In order to analyse and predict properties of the system, a number of constraints and approximations had to be made. These included approximations based upon the classical harmonic oscillator, placing the medium within a box and working under ensembles. The system was then equilibrated through modifying parameters such as time-step. Phase diagrams were studied to determine pressures and densities that fell under the solid, liquid and gaseous phases, pressures were altered and heat capacities calculated. Finally, the structures of different phases of the material were confirmed through radial distribution functions (RDF) and diffusion coefficients were calculated to study how atoms within the boundaries moved about.&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
In order to simulate a system even as basic as a simple liquid, there are several constraints. One main assumption is that the atoms within a liquid behave classically and the system. In a liquid, the atoms can translate and experience forces between each other, i.e. a N-atom system with N force equations. Another approximation made is that there are solely pair potentials, meaning that the potential energy is assumed to only exist between pairs of atoms within the liquid- this is the basis of the Lennard-Jones Potential used to calculate Van Der Wahl&#039;s interactions. Time is no longer considered a continuous entity and split into small defined time-steps, forming the Verlet algorithm. This predicts the position of atoms based on the previous time-step positions and does not depend on the particles&#039; velocities in previous time-steps. &lt;br /&gt;
&lt;br /&gt;
Velocity can be integrated into the Verlet algorithm in order to determine energies of the system (Velocity-Verlet algorithm). It is assumed that the change in acceleration between the two time-steps is small enough that the average acceleration can be taken from the mean of the initial and final time-steps. There is a certain amount of error associated with approximations and from numerical integrations, which can be minimised with the correct time-step values and other parameters.&lt;br /&gt;
&lt;br /&gt;
Five simulations were run at different time-steps ranging from 0.001-0.015 s. The position of the particle was based on the harmonic oscillator approximation &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;A=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi=0&amp;lt;/math&amp;gt;. The total energy was calculated as the sum of the kinetic &amp;lt;math&amp;gt; K = \frac{1}{2}mv^2&amp;lt;/math&amp;gt; and potential &amp;lt;math&amp;gt; U = \frac{1}{2}kx^2&amp;lt;/math&amp;gt; energies, where &amp;lt;math&amp;gt;m=k=1&amp;lt;/math&amp;gt; . In addition, error analysis was conducted by plotting the absolute difference between the values obtained from the classical harmonic approximation and Velocity-Veret solution: &amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ \ &amp;lt;/math&amp;gt; where v(0)= 0 and x(0)= 1.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;center&amp;quot;| [[File:HO NISH final.png|center]] &#039;&#039;&#039;Figure 1 Graphs showing Displacement vs Time (Top), Energy vs. Time (Middle), Error vs. Time (Bottom)&#039;&#039;&#039;&lt;br /&gt;
|} &lt;br /&gt;
Error maxima found at: (2.90,0.0007585), (4.90,0.0020077), (8.000.0033008), (11.10,0.0046039) and (14.20,0.0059105) at time-step 0.001.&lt;br /&gt;
&lt;br /&gt;
It can be seen that the displacement and (Figure 1 (Top)) of the particle oscillates from -1 to +1. The energy of the particle, much like the position, oscillates with time between 0.5000 and 0.4988 as the regular time-steps create a cycle. The displacements suggest that the classical harmonic oscillator is a reasonable approximation to make as the values behave accordingly. However, the total energy of the system fluctuates at different time-steps which is a deviation from the classical harmonic approximation, as there should be constant frequency throughout. The total average therefore needs to be constant, even if there are fluctuations, so the energy total is conserved and the simulation is valid. The increase in time-step increases the oscillation range as there are longer time periods between measurements.  Because of these deviations early on is our studies, it is important to analyse the error present at this time-step and modify the parameters to minimise this. At a time-step of 0.01s (Figure 1 (Bottom)), it can be seen that the error increases with increasing time-step, so the deviation from classical increases and the approximation becomes less accurate. The gradient of the linear error trend-line increases with increasing time-step, confirming that errors and deviation are more prevalent here.&lt;br /&gt;
&lt;br /&gt;
Altering the time-step affected the energy and error plots significantly. Too high a time-step creates deviations that cannot be considered fluctuations anymore. The time-step had to be kept under 0.2 to ensure an error deviation of less than 1% (&amp;amp;plusmn;0.005) and therefore further calculations based on this time-step or below are valid. The error plots for displacement calculations are also lower with decreasing time-step value, which is favourable. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean &amp;quot; the classical harmonic oscillator is a reasonable approximation to make&amp;quot;, you are simulating a classical harmonic oscillator in this task, it is not an approximation. Give the equation of the line fit to the maxima in the error.  Good analysis and choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|align=&amp;quot;center&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
|[[File:HO VARYTS ENERGY nish.png|thumb|500px|Figure 2. Graphs showing the reduced energy as a function of time with varying time-steps]]&lt;br /&gt;
&lt;br /&gt;
|[[File:HO VARYTS ERROR nish.png|thumb|500px|Figure 3. Graph showing the erroras a function of time with varying time-steps]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;&amp;lt;math&amp;gt;\mathbf{r_0}&amp;lt;/math&amp;gt; when potential energy is zero:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{12}}{{r_0}^{12}} - \frac{\sigma^6}{{r_0}^6}= 0&amp;lt;/math&amp;gt;&lt;br /&gt;
;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{{r_0}^{12}} = \frac{\sigma^6}{{r_0}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
;&amp;lt;math&amp;gt;\frac{\sigma^{12}{r_0}^6}{{r_0}^{12}\sigma^6} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
;&amp;lt;math&amp;gt;\frac{\sigma^{6}}{{r_0}^6}  = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
;&amp;lt;math&amp;gt;{\sigma^{6}} = {{r_0}^6}  &amp;lt;/math&amp;gt;&lt;br /&gt;
; &amp;lt;math&amp;gt;\sigma= r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Force expereinced at &amp;lt;math&amp;gt;\mathbf{r_0}&amp;lt;/math&amp;gt;:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}^0\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -(- 4&amp;lt;/math&amp;gt;x&amp;lt;math&amp;gt;12\epsilon \left( \frac{\sigma^{12}}{{r_0}^{13}} \right) + 4&amp;lt;/math&amp;gt;x&amp;lt;math&amp;gt;6\epsilon \left(\frac{\sigma^6}{{r_0}^7} \right))&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -(- 48\epsilon \left( \frac{\sigma^{12}}{{r_0}^{13}} \right) + 24\epsilon \left(\frac{\sigma^6}{{r_0}^7} \right))&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -(-48\epsilon \left( \frac{1}{{r_0}} \right) + 24\epsilon \left(\frac{1}{{r_0}} \right))&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -( -48\epsilon \left( \frac{1}{\sigma} \right) + 24\epsilon \left(\frac{1}{\sigma} \right))&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Equilibrium separation &amp;lt;math&amp;gt;\mathbf{r_{eq}} &amp;lt;/math&amp;gt; is when &amp;lt;math&amp;gt;\mathbf{F}_0=0 &amp;lt;/math&amp;gt; :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;- 48\epsilon \left( \frac{\sigma^{12}}{{r_{eq}}^{13}} \right) + 24\epsilon \left(\frac{\sigma^6}{{r_{eq}}^7} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;24\epsilon \left(\frac{\sigma^6}{{r_{eq}}^7}\right) = 48\epsilon \left( \frac{\sigma^{12}}{{r_{eq}}^{13}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(\frac{\sigma^6}{{r_{eq}}^7}\right) = 2\left( \frac{\sigma^{12}}{{r_{eq}}^{13}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1= \frac{2\sigma^6}{{r_{eq}}^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{r_{eq}} = {2}^\left(\frac{1}{6} \right)\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Well Depth &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)= 4\epsilon \left( \frac{\sigma^{12}}{{r_{eq}}^{12}} - \frac{\sigma^6}{{r_{eq}}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
=&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
=&amp;lt;math&amp;gt; 4\epsilon \left( \frac{1}{4}- \frac{1}{2}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
=&amp;lt;math&amp;gt; -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Evaluation of &amp;lt;math&amp;gt;\int_{2\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; :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; {4\left(\frac{-1}{11r^{11}} + \frac{1}{5r^5} \right) \Bigg\vert\,}_{2\sigma}^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; 0- 4\left(\frac{-1}{11*2^{11}} + \frac{1}{5*2^5} \right)&amp;lt;/math&amp;gt;= -0.0252&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Evaluation of &amp;lt;math&amp;gt;\int_{2.5\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; :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; {4\left(\frac{-1}{11r^{11}} + \frac{1}{5r^5} \right) \Bigg\vert\,}_{2.5\sigma}^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; 0- 4\left(\frac{-1}{11*2.5^{11}} + \frac{1}{5*2.5^5} \right)&amp;lt;/math&amp;gt;= -0.00820&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Evaluation of &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; :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3.0\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; {4\left(\frac{-1}{11r^{11}} + \frac{1}{5r^5} \right) \Bigg\vert\,}_{3\sigma}^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt; 0- 4\left(\frac{-1}{11*3.0^{11}} + \frac{1}{5*3.0^5} \right)&amp;lt;/math&amp;gt;= -0.00329&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1ml~ 1g/cm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;; number of molecules= moles x Avogadro&#039;s number = mass x N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt;/molar mass&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;math&amp;gt;\left(\frac{1}{2(1.01)+16}\right)&amp;lt;/math&amp;gt; x 6.02 x 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt;= 3.34 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt; Volume of 10000 water molecules under standard conditions:&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
moles= number of molecules/ Avogadro&#039;s number= 10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt;= 1.66 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; mol&lt;br /&gt;
&lt;br /&gt;
mass = moles x molar mass= (1.66 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt;) x (18.02) = 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; g&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; Volume = \frac{m}{\rho}= \frac{2.99 \mathrm{x} 10^-19}{1} &amp;lt;/math&amp;gt; = 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; ml&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;Working with reduced units allows for simplified calculations :&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The medium is contained within a box-like system, where if the displacement extends beyond the dimensions of the box, a replicate atom enters via the opposite face. For instance, an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; can be placed 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;. If it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; in a single time-step, it will end up at: &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Leonard-Jones parameters for the element Argon are: &amp;lt;math&amp;gt;\sigma=0.34 nm&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; (\frac{\epsilon}{K_B})= 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r= (r^*) /sigma= 3.2(0.34) &amp;lt;/math&amp;gt;= 1.09 nm&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T= \frac{1.5(120(K_B))}{(K_B)} &amp;lt;/math&amp;gt; = 1.5 x 120= 180 K&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\epsilon\ /\ k_B= -120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\epsilon\ = -120k_B&amp;lt;/math&amp;gt; = -0.998 kJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
Having placed the simulation in a box with periodic boundaries, it is essential that the system reaches equilibrium and the parameters can be modified accordingly to ensure this. In a liquid, there is no long range order. An initial idea would be to generate random co-ordinates for the atoms in the box but this brings its own set of problems. If two atoms happen to be generated so they&#039;re close in space together, there will be a lot of repulsive interactions , increasing the potential energy dramatically. In an harmonic oscillator , it is assumed that the total energy remains constant so this spike in potential energy will effectively break the approximation and create more error in the simulation values. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are simulating a Lennard-Jones system, not a harmonic oscillator here.  If the starting configuration has very high repulsive forces the simulation will be unstable and will crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to overcome this issue, the atoms are given starting co-ordinates of cubic structures such as Face-Centred Cubic (FCC) or Simple Cubic (SC). The size of the box can be restricted in the input file, where in the line &#039;lattice,&#039; the crystal structure type and the number density can be specified. For instance this line in the input file &amp;lt;pre&amp;gt;lattice sc 0.8&amp;lt;/pre&amp;gt; would generate a box of length 1.07722. In a simple cubic structure, there in only one lattice point per unit cell:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac\mathrm{Number\ of\ lattice\ points}\mathrm{Volume}= 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac\mathrm{Number\ of\ lattice\ points}{0.8}= \mathrm{Volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{0.8}= {\mathrm{Volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{1}{0.8})^\frac{1}{3}= {\mathrm{Side length}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Side length= 1.07722}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If instead a FCC structure was used to generate initial position co-ordinates, with a number density of of 1.2, there would be 4 lattice points in the unit cell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Number\ of\ lattice\ points}= \frac{1\mathrm{x}8}{8}+\frac{1\mathrm{x}6}{2}= 4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac\mathrm{Number\ of\ lattice\ points}\mathrm{Volume}= 1.2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac\mathrm{Number\ of\ lattice\ points}{1.2}= \mathrm{Volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{4}{1.2}= {\mathrm{Volume}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;(\frac{4}{1.2})^\frac{1}{3}= {\mathrm{Side length}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Side length= 1.49380}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The next few lines in the input script define the volume of space, i.e the number of unit cells. The line &amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt; generates 10x10x10 unit cells and so if the simulation were based upon a FCC structure, the number of lattice spacings would be (10x10x10)x4= 4000. &lt;br /&gt;
&lt;br /&gt;
The purpose of the following commands in the input script &lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&amp;lt;/pre&amp;gt; 1 type of atom each with a mass of 1.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Lennard-Jones potential pair energy interactions where the cut ff point is 3.0, beyond this distance there are no interactions.&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Dictates the field coefficients for all pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for a Lennard-Jones potential?  Why is a cut off used with this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are specified, the Velocity-Verlet algorithm can be used for integration. &lt;br /&gt;
&lt;br /&gt;
Before running the simulation, a time-step needs to be dictated in the input file, which coincides and agrees with the box constraints placed upon the liquid. It is important to set the time-step under a variable so that regardless of the time-step value, the simulations run for the same lengths of times and can be compared. If only the time-steps and runs were stated, they simulations would run for shorter lengths of time with shorter time-steps. &lt;br /&gt;
&lt;br /&gt;
{|align=&amp;quot;center&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
|[[File:totenergyvstime.png|thumb|300px|Figure 4. Graph showing the reduced energy as a function of time using a timestep of 0.001s]]&lt;br /&gt;
&lt;br /&gt;
|[[File:tempvstime.png|thumb|300px|Figure 5. Graph showing the reduced temperature as a function of time using a timestep of 0.001s]]&lt;br /&gt;
&lt;br /&gt;
|[[File:pressvstime.png|thumb|300px|Figure 6. Graph showing the pressure as a function of time using a timestep of 0.001s]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulation is at equilibrium at a time-step of 0.001 and the graphs of total energy, temperature and pressure show that the medium reaches the equilibrium zone within a few time-steps. The problem with a shorter time-step is that even though accurate results are obtained, they are only recorded for a shorter amount of time. This simulation requires observation over an extended period of time in order to allow the initial FCC or SC co-ordinates to arrange themselves into likely configurations.&lt;br /&gt;
&lt;br /&gt;
As can be seen in Figure 4, the simulation at a time-step of 0.01 is the largest time-step to give acceptable results, where the total energy begins to fluctuate around a value of -3.81. However at this time-step, there is a large amount of fluctuation, as can be seen by the large scatter of data values. &lt;br /&gt;
&lt;br /&gt;
A time-step of 0.015 gives a particularly bad result, as the energy does not equilibrate in the time period and shows no signs of doing so. The average value will therefore not be constant and an inaccurate representation of the system&#039;s energy. It is vital that the total energy of the system reaches a fluctuation zone as the simulation has been placed in a box-like space and under the ensemble (N,V,E). At this time-step the constraint is not in place. &lt;br /&gt;
&lt;br /&gt;
A compromise between accuracy and time length can be made with the time-step of 0.0025. There is minimal fluctuation and scatter of values, but also allows enough time for the particles in the system to be randomly dispersed, much like a liquid would be.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;center&amp;quot;| [[File:TOTENERGYVSTIME nish.png|center]] &#039;&#039;&#039;Figure 7 Graph Showing Total Energy VS. Time at Varying Time-Steps&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the timestep so timesteps of 0.01 and 0.0075 are not good choices.  0.0025 is the largest timestep that still gives the same average total energy as smaller timesteps so this is the best choice.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
In this section the ensemble is transformed from microcanonical (N,V,E) to isobaric-isothermal (NpT) in order to investigate simulations under these conditions. 10 simulations were run at temperatures ranging from 1.75-2.75 and at pressures of 0;2 and 0.8. The temperature tends to fluctuate in the system as the atoms interact in the box, however this can be made constant by altering the volume at each time-step. The constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; can be applied to the kinetic energy of the system, which will effectively alter the temperature so it remains constant. &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;
&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;
&amp;lt;math&amp;gt;\frac{3}{2} N k_B= \frac{1}{2 \mathfrak{T}}\sum_i m_i \left(\gamma v_i\right)^2= \frac{1}{2T}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2 \mathfrak{T}}\sum_i m_i (\gamma)^2 v_i^2= \frac{1}{2T}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2= \frac{\frac{1}{2T}\sum_i m_i v_i^2}{\frac{1}{2 \mathfrak{T}}\sum_i m_i  v_i^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2= \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma= &amp;lt;/math&amp;gt;&amp;amp;plusmn;&amp;lt;math&amp;gt; \sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the positive value of the square root is used as gamma should just scale the magnitudes of the velocities, not change their directions.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Towards the end of the input file, the lines dictate which properties of the system are recorded and averages them. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;100&#039; &#039;1000&#039; and &#039;100000&#039; in the penultimate line are N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; and N&amp;lt;sub&amp;gt;frequency&amp;lt;/sub&amp;gt; respectively:&lt;br /&gt;
&lt;br /&gt;
N&amp;lt;sub&amp;gt;every&amp;lt;/sub&amp;gt; is the frequency of values used from the input file, i.e. every hundred time-steps&lt;br /&gt;
&lt;br /&gt;
N&amp;lt;sub&amp;gt;repeat&amp;lt;/sub&amp;gt; is the number of values from the input file used for averaging, here it&#039;s 1000 atoms&lt;br /&gt;
&lt;br /&gt;
N&amp;lt;sub&amp;gt;frequency&amp;lt;/sub&amp;gt; dictates after how many time-steps the average is calculated, 100000 time-steps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nrepeat is 1000 values, not 1000 atoms.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;center&amp;quot;| [[File:nptdensitygraphns.png|center]] Figure 8 Graphs displaying density vs. temperature at different pressures&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The densities generated by the simulation can be compared with those calculated based on the ideal gas law. At both pressures it can be seen that the predicted densities are almost double that of the simulated densities. The main assumption in the ideal gas law is that there are no interatomic interactions, which are accounted for in the Lennard-Jones simulation. The lack of repulsive forces means that the atoms can be close together in the prediction with no expense of potential energy, thus the density is higher. There is a larger difference between the predicted and actual values at the higher pressure of 2.75. The predicted values increase linearly as the pressure is increased (pV=nRT), however with the actual values, this is not the case. The interatomic attractions and repulsions mean that the density doesn&#039;t increase as much as the predicted values do, causing the gap expansion in values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How can you tell if the simulation results increase linearly with pressure if you only have data for 2 pressures?  Show all data on the same graph so that you can compare the data at different pressures and different temperatures.  The ideal gas is a good approximation to a dilute gas (high temperature, low pressure).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
The simulations were run under a density-temperature phase in order to calculate the heat capacity. A temperature range of 2-2.8 and pressures of 0.2 and 0.8 were used. The magnitude of fluctuations in the system can inform us of the heat capacity of the material, which can be plotted as a variance of the energy against temperature. &lt;br /&gt;
&lt;br /&gt;
The following input script was used, varying the temperature and density &amp;lt;pre&amp;gt;### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable D equal 0.2&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${D} &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;
### 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 atoms vol &lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_energy v_temp v_energy2 v_temp2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable aveenergy2 equal f_aves[3]&lt;br /&gt;
variable ave2energy equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable heatcap equal (${n2}*(${aveenergy2}-${ave2energy})/(${avetemp}*${avetemp}))&lt;br /&gt;
variable heatcapperunitvolume equal (${n2}*(${aveenergy2}-${ave2energy})/(${avetemp}*${avetemp}))/${vol}&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity Per Unit Volume: ${heatcapperunitvolume}&amp;quot; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! align=&amp;quot;center&amp;quot;| [[File: heatcapns.png|center]] Figure 9 Graphs displaying heat capacity vs. temperature at different densities&lt;br /&gt;
|}&lt;br /&gt;
The general trend displayed in Figure 8 is that as the temperature increases, the heat capacity decreases- a system at a higher temperature requires less energy to be heated incrementally than a system at a lower temperature. This is because the density of states is larger at a higher temperature system and less energy is needed to move up the vibrational states, which are closer together. In addition the particles are further apart at a higher temperature and so fewer interatomic interactions take place, increasing the energy put towards heating the system instead of overcoming repulsive forces, thus lowering the heat capacity.A more dense system has a higher heat capacity as a result of the larger number of particles per unit volume. In a more dense system, more energy has to be applied to heat the particles to the same extent as a less dense system, increasing the heat capacity directly. With an increasing number of particles, there is also more degrees of vibrational freedom and more lost pathways.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of the increase in heat capacity with density and good suggestions to explain the trend with temperature, more analysis would be needed to confirm this.  Remember that these simulations are of spherical particles and so there are no vibrational energy levels.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Radial Distribution Function==&lt;br /&gt;
Plotting the radial distribution functions of a simulated medium can give insight into the positioning of atoms relative to each other. It is also a way of confirming that the force field coefficients are in place in the LJ type system. &lt;br /&gt;
{|align=&amp;quot;center&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
|[[File:Rdf nishs.png|thumb|300px|Figure 10graph showing how radial distribution varies with distance]]&lt;br /&gt;
&lt;br /&gt;
|[[File:Rdfintnish.png|thumb|300px|Figure 11 Integration of radial distribution along increasing distance]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order to analyses the radial distributions of the sample in three phases, the density and temperature parameters had to be altered so they fell in the correct phase boundaries. These were the following values used according to the phase diagram for the Lennard-Jones potential system &amp;lt;ref name =&amp;quot;Phase&amp;quot;/&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
Solid Temp= 0.75 Density= 1.2&lt;br /&gt;
&lt;br /&gt;
Liquid Temp= 1.2  Density= 0.8&lt;br /&gt;
&lt;br /&gt;
Gas Temp= 1.2 Density= 0.03&lt;br /&gt;
&lt;br /&gt;
The radial distribution for the solid phase shows long-range ordering, as there are nearest neighbours from the first co-ordinate. The first peak corresponds to the co-ordinate of an atom from which the neighbours are displayed relative to it:&lt;br /&gt;
&lt;br /&gt;
(1.025	5.29) nn= 12-0= 12&lt;br /&gt;
&lt;br /&gt;
(1.475	1.13) nnn= 18-12= 6&lt;br /&gt;
&lt;br /&gt;
(1.825	3.28) snnn= 42-18= 24&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The co-ordinates displayed for the solid phase are roughly periodic with distance (~distance= 0.425) confirming the regular lattice structure with the applied temperature and density parameters. There are defects present in the solid structure seen at  (2.125, 1.173378937) and these are sue to statistical errors as a results of the rigid system.&lt;br /&gt;
&lt;br /&gt;
In a liquid however, these defects are smoothed out in the dynamic averaging. There is no long range ordering as the atoms translate over each other.  The RDF quickly fluctuates around 1 after r= 2.225 as beyond this distance, there are no neighbours. The gas displays no nearest neighbours as the atoms are very far apart and with n long range ordering. Only the initial co-ordinate is recorded in the distance under which the simulation is recorded.&lt;br /&gt;
&lt;br /&gt;
Looking at the RDF integrals, the solid has the greatest area under the curve due to its regular structure where the particles are close to one another. Looking from a point reference atoms, there are lattices extending from every dimension and so the integral increases exponentially. With liquids, there is some long range ordering so the integral also increases but at a slower rate. The gaseous phase has the lowest density and no ordering so as the particles are far apart, it&#039;s difficult to come across one along a distance and the area under the curve is small.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The peaks are not always the same distance apart in the solid RDF because the distance to different groups of nearest neighbour atoms in an fcc lattice are different, this is not because of defects.  The liquid has short range order, but no long range order.  Did you zoom in to the distance of the first three peaks in the solid RDF integral plot - this will tell you how many atoms contribute to each peak.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamic Properties and Diffusion Coefficient==&lt;br /&gt;
The diffusion coefficient is a useful form in which to study the extent to which atoms move around in a simulation and can be calculated via two methods. One way is through the means square displacement which measures the difference between the position of a particle and a reference position in the box. Another method is to use the velocity autocorrelation function where the velocity of an atom does not depend on its velocity several time-steps ago, i.e. the movement is  dynamic and irregular. The phase conditions from the previous section were used to simulate the solid, liquid and gaseous phases in the smaller system.&lt;br /&gt;
&lt;br /&gt;
{|align=&amp;quot;center&amp;quot;&lt;br /&gt;
       &lt;br /&gt;
|[[File:MSDSOLIDns.png|thumb|300px|Figure 12 Graph showing MSD vs. average time-step for solid phase (time-step= 0.002)]]&lt;br /&gt;
&lt;br /&gt;
|[[File:MSDLIQUIDns.png |thumb|300px|Figure 13 Graph showing MSD vs. average time-step for liquid phase (time-step= 0.002)]]&lt;br /&gt;
&lt;br /&gt;
|[[File:MSDVAPns.png|thumb|300px|Figure 14Graph showing MSD vs. average time-step for gas phase (time-step= 0.002)]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
Figures 12,13 and 14 display the MSD vs. average time-step for the three phases. In the solid phases, the MSD quickly shoots up and then proceeds to fluctuate around a particular value; In the small system of 8000 atoms and large system of 1 million atoms, its fluctuates around a value of 0.0014 and 0.02 respectively. The difference in the displacement becoming a constant value within a few time-steps confirms the rigidity of the structure created, where the atoms have remained in a lattice structure due to to the temperature and pressure conditions. &lt;br /&gt;
&lt;br /&gt;
Once the temperature and pressure values are altered to allow for liquid and vapour phases, it can be seen that the MSD increases roughly linearly with time. This implies that there are particles at several different positions from the reference position and that they are dispersed randomly with no structure. The gradient for the vapour phase is almost 40 times larger than the gradient for the liquid phase as there are infinitely more degrees of freedom as you move from the liquid to gaseous phase. A liquid may not have long range ordering, but the particles are much closer and translate over each other, whereas in a gas the particles are further apart and no ordering at all. This explains the slight curve at the beginning of the gaseous graphs, where no particles are found within the first few time-steps as they are so far apart. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients below in table were calculated using the formula &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; where the gradient from the graphs was &amp;lt;math&amp;gt;\partial\left\langle r^2\left(t\right)\right\rangle&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;|&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;| Diffusion Coefficients calculated using MSD data&lt;br /&gt;
|-&lt;br /&gt;
! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot;|&lt;br /&gt;
! MSD&lt;br /&gt;
| 8.33E-07 || 8.33E-02 || 3.41&lt;br /&gt;
|-&lt;br /&gt;
! MSD 10&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;  atoms&lt;br /&gt;
| 4.17E-06 || 8.33E-02 || 2.54&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are significantly higher as the material transforms from the solid to gaseous phases because of the increasing degrees of freedom. The particles also have larger velocities in the gas and the interatomic interactions are significantly reduced as the pressure is reduced, so the particles can move more freely. Comparing the coefficients obtained for the two systems, the solid phase shows the greatest difference in values between the small and large systems, differing in the order of 10, as increasing the number of particles increases the degrees of freedom. The effect is not as severe in the gaseous system as the particles have minimal ordering so the size of the system has little effect on the degrees of freedom that can be accessed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Only fit a straight line to the linear part of the MSD graph to calculate D, as this represents the diffusive regime.  The curved part of the MSD represents ballistic motion, rather than diffusion.  What do you mean by saying there are more degrees of freedom in a gas phase than a liquid phase?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can also be calculated using the velocity autocorrelation function (VACF), which is denoted by: &amp;lt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated using &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Classical harmonic oscillator: &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
VACF for a 1D HOis : &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;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;&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;
&amp;lt;math&amp;gt;=  \frac{\int_{-\infty}^{\infty}( -\omega A\sin\left(\omega t + \phi\right)) (-\omega A\sin\left(\omega (t + \tau)+ \phi\right))\mathrm{d}t}{\int_{-\infty}^{\infty} (-\omega A\sin\left(\omega t + \phi\right))^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty}( -\omega A\sin\left(\omega t + \phi\right)) (-\omega A\sin\left(\omega t + \omega\tau+ \phi\right))\mathrm{d}t}{\int_{-\infty}^{\infty} (-\omega A\sin\left(\omega t + \phi\right))^2\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty}( \omega A\sin\left(\omega t + \phi\right)) (\omega A\sin\left(\omega t + \omega\tau+ \phi\right))\mathrm{d}t}{\int_{-\infty}^{\infty} \omega^2 A^2\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}( \omega A\sin\left(\omega t + \phi\right)) (\omega A(\sin\left(\omega t + \phi\right)\cos(\omega t)+\cos\left(\omega t + \phi\right)\sin(\omega t)))\mathrm{d}t}{\int_{-\infty}^{\infty} \omega^2 A^2\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{\omega^{2}A^{2}cos(\omega t)\int_{-\infty}^{\infty}(sin^{2}(\omega t + \phi))}{\omega^{2}A^{2} \int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) \, dt} + \frac{\omega^{2}A^{2}sin(\omega t)\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))}{\omega^{2}A^{2}\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) \, dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega t) + \frac{sin(\omega t)\int_{-\infty}^{\infty}(sin(\omega t + \phi)cos(\omega t + \phi))}{\int_{-\infty}^{\infty} (sin^{2}(\omega t + \phi)) \, dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= cos(\omega t) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how did you simplify the integral in the last line?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|align=&amp;quot;center&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:VACFNSFINAL.png|400px|thumb|center|Figure 15 VACF vs. time-step for varying conditions]]&lt;br /&gt;
&lt;br /&gt;
Figure 15 shows how VACF integrals for solid and liquid phases differ to the harmonic oscillator pathway. The VACF for the harmonic oscillator oscillates regularly between -1 and 1 due to the close packed regular structure of the approximation where there is no interatomic interaction. The graph shows that it has more long range ordering than the solid because it doesn&#039;t have to overcome any interatomic repulsions and that the liquid displays the least long range ordering. Neither of the phases coincide with the harmonic oscillator as it&#039;s far too regular and ideal.&lt;br /&gt;
       &lt;br /&gt;
|[[File: VACFSOLIDNS.png|thumb|300px|Figure 16 Graph showing VACF vs. average time-step for solid phase ]]&lt;br /&gt;
&lt;br /&gt;
|[[File: VACFLIQUIDNS.png |thumb|300px|Figure 17 Graph showing VACF vs. average time-step for liquid phase]]&lt;br /&gt;
&lt;br /&gt;
|[[File: VACFGASNS.png |thumb|300px|Figure 18 Graph showing VACF vs. average time-step for gas phase]]&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; rowspan=&amp;quot;2&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;|&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;| Diffusion Coefficients calculated using MSD data&lt;br /&gt;
|-&lt;br /&gt;
! Solid !! Liquid !! Gas&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot;|&lt;br /&gt;
! MSD&lt;br /&gt;
| 4.89E-05 || 0.090 || 4.92&lt;br /&gt;
|-&lt;br /&gt;
! MSD 10&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;  atoms&lt;br /&gt;
| 4.55E-05 || 8.33E-02 || 3.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Once again, it can be seen that the diffusion coefficient increases from the solid to gaseous phase. Here the coefficient is calculated using velocities and so the higher diffusion coefficient corresponds to this increase in velocity. All three phases approach a maxima, and then the solid phase rise sharply down to 0 and fluctuates around this region. The fluctuation around 0 corresponds with the structured lattice of this phase, where the particles can only vibrate and have severely restricted movements. The liquid phase fluctuates around a value of 0.25. The gaseous phase however, does not reach fluctuation and the integral contrinues to increase expnenetially to the end of the averaging time-steps. &lt;br /&gt;
&lt;br /&gt;
A big of error when estimating the diffusion coefficient from the VACF results from using the trapezium rule to approximate the integral under the VACF. The VACF graphs isn&#039;t strictly linear and more exponential-like, and hence the diffusion coefficient would be lower than expected when using this approximation. The error could be reduced by using a larger number of smaller trapeziums to calculate the integral, but this is a lot more extensive and may require more computing power.  The trends obtained from the MSD and VACF methods align with one another and provide sufficient evidence that the three phases have been observed. The coefficients are within the same order for the liquid and gaseous phases, but not the solid phase. This may be due to statistical defects when simulating the positions of the particles in the MSD calculation, but most likely due to the error when using the trapezium rule in the VACF calculation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Don&#039;t confuse the VACF with the RDF, the VACF indicates how correlated particle velocities are over time, not spatial ordering.  Decorrelation is due to collisions between particles which randomise particle velocities and makes the VACF decay to zero.  There are no collisions in the harmonic oscillator so the VACF doesn&#039;t decay.  When is the VACF negative?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
In conclusion molecular dynamic simulations were used to examine the properties of the solid, liquid and vapour phases. The Lennard-Jones fluid was simulated in a NVE/NpT ensemble with varying timesteps and the thermodynamic properties were measured, such as heat capacity. The simulations were run under different temperatures, pressures, timesteps and densities. It was found that the optimal timestep was 0.0025 s in terms of computational efficiency and accuracy. Increasing the density of the system decreases with an increase in temperature and the heat capacity of a Lennard-Jones fluid decreases with increasing temperature, as well as with decreasing density. The RDF gave insight into the coordination numbers corresponding to the first three peaks for the solid phase and  was determined from the integral of RDF graph. The diffusion coefficient then was calculated for the solid, liquid and gas via two different methods; MSD and VACF. The MSD was found to be a better method since there was a large source of error associated with the VACF method.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name =&amp;quot;Phase&amp;quot;/&amp;gt; Hansen, Verlet, Phase Transitions of the Lennard-Jones System, Phys. Rev.  1969,184, 151&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Tfy286&amp;diff=612341</id>
		<title>Talk:Mod:Tfy286</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Tfy286&amp;diff=612341"/>
		<updated>2017-03-28T06:07:36Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks attempted, but some of the written explanations lacked a bit of detail.  Make sure you have a good understanding of the theoretical background to the tasks and use this to explain the trends that you see in your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
1. 1). Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&lt;br /&gt;
&lt;br /&gt;
2). For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&lt;br /&gt;
&lt;br /&gt;
[[file:A.e.e.PNG]]&lt;br /&gt;
&lt;br /&gt;
2. Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;The maximum energy is 0.5. If the total energy does not change by more than 1%, the minimum energy should be 0.5*(1-1%)=0.495. Therefor the timestep is required to change to 0.2 (or less than 0.2).  Here is the new diagram when timestep equals to 0.2.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[file:Energy.change.PNG|x400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What is the equation for the straight line that you&#039;ve plotted through the maxima in the error?  Why does the error oscillate over time?  Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
&#039;&#039;&#039;1). when potential energy=0, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;=0. So,&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2). energy is zero, so net force is zero as well.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The force is the first derivative of the potential, so it is not necessarily zero when the energy is zero, look at a plot of the Lennard-Jones potential, when the potential is zero is the gradient also zero?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3). at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, potential energy is minimum, &amp;lt;math&amp;gt; \frac{d\phi}{dr}\ &amp;lt;/math&amp;gt; = 0, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\dfrac{48\epsilon\sigma^{12}}{\sigma^{13}} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\dfrac{24\epsilon\sigma^{6}}{\sigma^{7}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
So, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sqrt{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: At r_eq, r is not sigma, the correct answer should be r = 2^(1/6)*sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4). &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;\dfrac{-4r^{-11}}{11}+\dfrac{4r^{-5}}{5}= -0.0248&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&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177*10^{-3}&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&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-3.29*10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1). density of water is &amp;lt;math&amp;gt;1g/cm^3 &amp;lt;/math&amp;gt;, no.(water)= &amp;lt;math&amp;gt;\frac{1}{18}* 6.023* {10^{23}}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346*10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2). &amp;lt;math&amp;gt;\dfrac{1}{3.346*10^{22}}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\dfrac{volume(H2O)}{10000}&amp;lt;/math&amp;gt;, so volume of 10000 water molecules is  &amp;lt;math&amp;gt;2.98*10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The new position &amp;lt;math&amp;gt;\left(0.5+0.7, 0.5+0.6, 0.5+0.2\right)=\left(1.2, 1.1,0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;However it follows the periodic boundary condition, so it should be &amp;lt;math&amp;gt;\left(0.2, 0.1,0.7\right)&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) r= 0.34* 3.2 nm = 1.088nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon= 120 * 1.38 *10 ^{-23} * 10^{-3} * 6.023 *10 ^{23} kJ/mol = 0.9974 kJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) T= 120* 1.5 K = 180K&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===task===&lt;br /&gt;
1. Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If two atoms are too close together, there will be a huge repulsion existing between them. In order to calculate the huge energy change, the timestep should be very small. Therefore the computation process will be much more difficult. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the simulation will crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;there are four lattice points per volume per unit cell in a face-centred cubic.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{\tfrac{4}{1.2}} = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4*(10*10*10) = 4000 atoms will be created. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Using the LAMMPS manual, find the purpose of the following commands in the input script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1 indicates the atom type, here is type 1.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.0 indicates the atom mass, here is 1.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut means cutoff Lennard-Jones potential with no Coulomb, &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3.0 is the arguments used by a particular style &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asterisks here are used in place of or in conjunction with the I,J arguments to set the coefficients for multiple pairs of atom types. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.0 and 1.0 here are the coefficients for the atom types&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for the Lennard-Jones potential?  Why is a cutoff used with this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;velocity-Verlet algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If the timestep is fixed at 0.001, once the timestep is required to change, all the timesteps will change into other values by hand.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;However, if the timestep is set as a variable, only the first line is required to change, and the rest of them will change automatically. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.1) make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report).&lt;br /&gt;
&lt;br /&gt;
[[File:E.t.p]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Does the simulation reach equilibrium? How long does this take? &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Yes, the simulation reaches equilibrium when time= 0.43&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report).&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.timestep.PNG|x600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4)Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0.01 is the largest to give acceptable result. And 0.015 is a particular bad choice because there is a big deviation from the others.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Make the x axis range equal to the length of the shortest simulation.  Should the average total energy depend on the choice of timestep?  0.0025 is the best choice as it gives the same results as shorter timesteps (0.001), but simulations can cover a larger length of time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
1. Choose 5 temperatures (above the critical temperature T^* = 1.5), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen \left(p, T\right) points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Pressure&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Temperature&lt;br /&gt;
|-&lt;br /&gt;
| 2.7 , 2.8&lt;br /&gt;
| 1.8 , 1.9 , 2.0 , 2.1 , 2.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 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:&#039;&#039;&#039;&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;. Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;So, &amp;lt;math&amp;gt;\sum_i m_i \left(\gamma v_i\right)^2 = 3 N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \frac{1}{\sum_i v_i} \sqrt{\dfrac{3 N k_B}{\sum_i m_i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Not quite, take gamma out of the sum and then substitute the sum for the equation involving the current temperature, T, to get &amp;lt;math&amp;gt;\gamma = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;100 stands for the number of input values every this many timesteps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1000 stands for the number of times to use input values for calculating averages&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;100000 stands for calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Therefore the value of temperature will sampled for 1000 times. And there are 1000 measurements contributing to the average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Add more detail to show that you understand what the manual is saying about these three values.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 1). When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
&lt;br /&gt;
[[File:Density temperature 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The higher the pressure the discrepancy increases. &lt;br /&gt;
&lt;br /&gt;
2). You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;according to the ideal gas law, &amp;lt;math&amp;gt; p V = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; density = \frac{N}{V}= \frac{p}{k_B T} = \frac{p}{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;(reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; The simulated density is lower than the ideal density. Because there are interaction forces existing among particles. When the pressure is applied, the repulsion between particles becomes dominant, and the distance between particles will be larger, so the density will be lower than the ideal situation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show all results on the same axes so that the trend with pressure is clear and don&#039;t plot a straight line between data points, especially for the ideal gas as the ideal gas law doesn&#039;t follow this trend (density is proportional to 1/T).  How does the discrepancy change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
===Task===&lt;br /&gt;
1. input script&lt;br /&gt;
 &amp;lt;pre&amp;gt;### DEFINE PARAMETERS ###&lt;br /&gt;
variable D equal 0.2&lt;br /&gt;
variable T equal 2.8&lt;br /&gt;
variable timestep equal 0.0075&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${D} &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;
### 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 atomss equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable energyvariance equal (f_aves[8]-f_aves[7]*f_aves[7])&lt;br /&gt;
variable heatcap equal ${atomss}*${avedens}*${energyvariance}/(f_aves[5])&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcap per volume: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Plot C_V/V as a function of temperature&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacity change.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How does the heat capacity change with density?  Can you give any suggestions about why the heat capacity decreases with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task===&lt;br /&gt;
1. perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate g(r) and &amp;lt;math&amp;gt; \int g(r)\mathrm{d}r &amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf of three states.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf 2.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;g(r) shows several peaks in the liquid state, which means the probability at these radial distances will be much higher than the others. Secondly, there are much more peaks observed in solid phases. The peak differences are caused by the different interaction forces. In liquid phases, the attractive force is dominant, and in the solid phase, the structure is regular and periodic, the interaction is stronger than in liquid phase,  and the repulsive force is dominant.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;For face centred cubic, regarding (0,0,0) as a center, the first three peaks correspond to (1/2,1/2,0), (1,0,0) and (1,1,0).&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The difference from 0 to the second peak is the lattice point, 1.475.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The solid has peaks at large r which indicates long range order, the liquid only has short range order.  A diagram of an fcc lattice to show the atoms responsible for the first 3 peaks would have been good, did you calculate the coordination numbers as well - you can get these from the integral if you zoom in to look at the r values of the first 3 peaks.  Could you have calculated the lattice parameter from the first and third peaks as well and taken an average, how does it compare with the initial value that you use in the LAMMPS script?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficienT==&lt;br /&gt;
===Task===&lt;br /&gt;
1. make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(SOLID)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(LIQUID)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(GAS)&lt;br /&gt;
|-&lt;br /&gt;
| [[File:MSD SOLIDTFY.PNG]]&lt;br /&gt;
| [[File:MSD LIQTFY.PNG]]&lt;br /&gt;
| [[File:MSD GAS.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Are these plots for your simulation data or the data that you are given.  Is the solid MSD what you&#039;d expect - it doesn&#039;t look like the atoms are confined to lattice sites, did you change the lattice type to fcc?  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt; MSD= \langle (x(t)-x_0)^2 \rangle = 2Dt &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D= \tfrac{MSD}{2t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For solid, D = 0.0273/(2*0.016991) = 0.803&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For liquid, D = 2.81/(2*1.67448) = 0.839&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For gas, D = 12.9/(2*7.74)= 0.8333&lt;br /&gt;
&lt;br /&gt;
the MSD data given&lt;br /&gt;
[[File:Msd example.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you explain these graphs, are the data for the three phases on top of each other, is this what you would expect?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \tfrac{1}{3} \int_{0}^{\infty} C\left(\tau\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. 1). In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
Be sure to show your working in your writeup.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a 1D harmonic oscillator&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;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t+\tau\right) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because &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;
For the upper integration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin\left(\omega (t+\tau) + \phi\right) sin\left(\omega t + \phi\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin\left(\omega t + \phi\right) (sin\left(\omega t + \phi\right) cos(\omega\tau)+ sin\left(\omega\tau)cos(\omega t + \phi\right)) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 cos(\omega\tau)\int_{-\infty}^{\infty} sin^2 \left(\omega t + \phi\right) dt + A^2 \omega^2 sin(\omega\tau)\int_{-\infty}^{\infty}sin\left(\omega t + \phi\right) cos\left(\omega t + \phi\right) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the lower integration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} v^2\left(t\right)dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin^2 \left(\omega t + \phi\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\omega\tau) + sin(\omega\tau) \int_{-\infty}^{\infty}\dfrac{cos(\omega t + \phi)}{sin\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =cos(\omega\tau) + sin(\omega\tau)\dfrac{ln(|sin\left(\omega t + \phi\right)|)}{\omega}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from &amp;lt;math&amp;gt;-\infty &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; \infty &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\omega\tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, but check your working again, you cannot simplify the integrals like you have done.  You can make the derivation easier and avoid doing any integration by recognising the integrands as even and odd functions and simplifying them accordingly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2). On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt; \omega = 1/2\pi &amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\tfrac{1}{2} \pi \tau) + 2\dfrac{sin(\tfrac{1}{2} \pi\tau)}{\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcav.PNG]]&lt;br /&gt;
&lt;br /&gt;
3). What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The minima represents the starting points of self-diffusion. &#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The origin of the differences is the interaction force difference. The interaction is larger , so the diffusion coefficient is smaller, which can be also observed by the area difference under the VACF(r) curve of two different phases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Look at the equation for the VACF, when is it negative and so when do the minima occur?  Collisions between particles randomise particle velocities and cause the VACF to decorrelate, there are not collisions in the harmonic oscillator so it doesn&#039;t decay.  You should have plotted the harmonic oscillator VACF with omega = 1/(2*pi).  Did you try to calculate the running integral of the VACF or the diffusion coefficient from this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:KS5214LS&amp;diff=612340</id>
		<title>Talk:Mod:KS5214LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:KS5214LS&amp;diff=612340"/>
		<updated>2017-03-28T06:03:38Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Simulation results look good and all task answered.  Try to make your answers more concise and focus on answering the question, referring specifically to your own results, rather than making general comments.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
Molecular Dynamics Simulations aim to describe how a set of atoms move over time, using classical mechanics. Whilst the simulation carried out here are of simple systems, MDS can be used to further understand complex systems such as biological systems. &lt;br /&gt;
Here the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) was used in order to simulate the movement of the particles with respect to time using the velocity-Verlet algorithm. This allowed us to model the movement of atoms and extract thermodynamic properties. It also clearly portrayed the limitations of the program and the approximations used, especially when it comes to vapor and solid systems as it was proven that the approximations used provide reasonable and comparable results for liquid systems, but large discrepancies for vapor and solid phases.&lt;br /&gt;
&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of the classical harmonic oscillator as a function of time was determined using:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt; &lt;br /&gt;
with &amp;lt;math&amp;gt;A=1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.0&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi=0.0&amp;lt;/math&amp;gt; &lt;br /&gt;
yielding an analytical solution to the position, which as seen from Figure 1 below, seems to be in agreement with the Velocity-Verlet algorithm. &lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Time vs Position KS5214.png|thumb|750px|Figure 1:Position of a classical harmonic oscillator as a function of time (timestep=0.1)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the velocity and acceleration of a simple harmonic oscillator oscillate with the same frequency as the position, but with shifted phases. In simple harmonic motion when the displacement is maximum the velocity is at zero and when the displacement is zero, the velocity is at maximum. The acceleration on the other hand is at maximum when the displacement is at maximum and it is at zero when displacement is at 0. &lt;br /&gt;
&lt;br /&gt;
The energy of the classical harmonic oscillator was then determined using:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;E=\frac{1}{2}mv^2+\frac{1}{2}kx^2&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
with &amp;lt;math&amp;gt;m=1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;k=1.0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x\left(t\right)&amp;lt;/math&amp;gt; affording Figure 2.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Energy of Classical Harmonic Oscillator as a function of time ks5214.PNG|thumb|750px|Figure 2:Energy of a classical harmonic oscillator as a function of time (timestep=0.1)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result obtained (Figure 2) is a periodic motion, repeated in a sinusoidal fashion. It maintains a constant amplitude, with a range between 0.5000 and 0.499. The harmonic oscillator has a period of 6.50 (time of single oscillation) and a frequency of 0.154 (number of cycles per unit time). &lt;br /&gt;
The position at a given time, t depends on the phase, φ, which was predetermined to 0.00, giving the starting point on the sine wave, the period and frequency are determined by the size of the mass, m (m=1.00)  and the force constant, k (k=1.00) whilst the amplitude and phase are determined by the starting position, X(0) (X(0)=1.00) and velocity, V(0) (V(0)=0.00). For an ideal harmonic oscillator, the total energy would be expected to be constant therefore the simulation does not provide an ideal result. However the fluctuation is of a magnitude of 0.00149 energy units, which approximates to 0.25% of the energy therefore the error is small and the physical behavior predicted can be considered acceptable for the purposes of the experiment. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows the discrepancy between the classical, analytical solution and the solution from the Velocity-Verlet algorithm. &lt;br /&gt;
Whilst Figure 1 shows an agreement between the Valocity-Verlet algorithm and the analytical calculation, Figure 3 suggest that there is a small variation between the two solutions and thus the Velocity-Verlet algorithm results to an error in the caclulation. The error is biggest for values of time that give position close to 0, and error at these points increases linearly with time according to:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\left( y= 4.18*10^{-4}\cdot t + 3.81*10^{-5}\right)&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
This linear increase in error is due to the Taylor expansion of the integral used in the Velocity-Verlet algorith.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The increase in the error is due to accumulation of error over time.  Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 3 Error Energy Maxima as a function of time.PNG|thumb|750px|Figure 3: Linear fit to Error Function Maxima|none]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It was found that the sinusoidal fluctuation of the energy increases with increasing timesteps. On the other hand, the absolute value of the energy decreases. &lt;br /&gt;
As aforementioned for a timestep of 0.10, the fluctuation is very small of 0.25% energy change. As the timestep increases to 0.20 and 0.30 the fluctutaions produced are 1.00% and 2.00% of energy respectively.&lt;br /&gt;
The 0.20 timestep was found to be the limiting value with fluctuations at 1.00% (figure XX) and therefore, a timestep below 0.20 has to be chosen in order to keep energy fluctuations less that 1.00%.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy when performing the simulations as energy is meant to be constant over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 4 Energy of Classical Harmonic Oscillator as a function of time (timestep=0.2).PNG|thumb|750px|Figure 4:Energy of a classical harmonic oscillator as a function of time (timestep=0.2)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 5 Energy of Classical Harmonic Oscillator as a function of time (timestep=0.3).PNG|thumb|750px|Figure 5:Energy of a classical harmonic oscillator as a function of time (timestep=0.3)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because only when the system obeys physical laws (energy conservation in this case) to a certain extent, the outputs of the simulation can be considered meaningful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_0\right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^6}{r_{0}^6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^6}=\frac{r_{0}^{12}}{r_{0}^6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The potential energy is 0 at &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a single particle with &amp;lt;math&amp;gt;r=r_{0}=\sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;F=-\frac{\mbox{d}\ U\left(r^N\right)}{\mbox{d}\ r}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-\frac{\mbox{d}\ \phi\left(r_0\right)}{\mbox{d}\ r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-\frac{d\left[4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)\right]}{\mbox{d}\ r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-24\epsilon \left( \frac{\sigma^{6}}{r_{0}^{7}} - \frac{2\cdot\sigma^{12}}{r_{0}^{13}} \right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-24\epsilon \left( \frac{r_{0}^{6}}{r_{0}^{7}} - \frac{2\cdot r_{0}^{12}}{r_{0}^{13}} \right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{48\epsilon}{r_0} - \frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt;r=r_{0}=\sigma&amp;lt;/math&amp;gt;, the force is &amp;lt;math&amp;gt;F=\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;.&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;).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The system is at equilibrium when F=0:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;F\left(r_{eq}\right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-\frac{\mbox{d}\ \phi\left(r_{eq}\right)}{\mbox{d}\ r_{eq}}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-\frac{\mbox{d}\left[4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)\right]}{\mbox{d}\ r_{eq}}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-24\epsilon \left( \frac{\sigma^{6}}{r_{eq}^{7}} - \frac{2\cdot\sigma^{12}}{r_{eq}^{13}} \right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_{eq}^{7}} = 2\cdot\frac{\sigma^{12}}{r_{eq}^{13}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_{eq}^{6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
Equilibrium separation is &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=4\epsilon \left( \frac{\sigma^{12}}{\left({\sqrt[6]2}\ \sigma\right)^{12}} - \frac{\sigma^6}{\left({\sqrt[6]2}\ \sigma\right)^6} \right)=4\epsilon \left( \frac{1}{2^{2}} - \frac{1}{2} \right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The well depth at &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mbox{d}r=\int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mbox{d}r=\int_{2}^\infty 4\left( \frac{1^{12}}{r^{12}} - \frac{1^6}{r^6} \right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_2=-2.48\cdot10^{-2}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_{2.5}=-8.18\cdot10^{-3}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\int_{3\sigma}^\infty\phi\left(r\right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_3=-3.29\cdot10^{-3}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and nicely laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At standard conditions&amp;lt;ref&amp;gt;Handbook of Chemistry and Physics, 84th ed., D.R. Lide, CRC, pp. 4-94&amp;lt;/ref&amp;gt; &amp;lt;math&amp;gt;\rho=999.7\ \frac{kg}{m^3}=0.9997\ \frac{g}{mL}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using Avogadro&#039;s number, &amp;lt;math&amp;gt;N_A=6.022\cdot10^{23} mol^{-1}&amp;lt;/math&amp;gt; and molar mass of water, &amp;lt;math&amp;gt;M_{H_{2}O}=18\ {g}{mol}^{-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;m=\frac{\rho}{V}=\frac{0.9997}{1}=0.9997\ g&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;n=\frac{m}{M}=\frac{0.9997}{18}=0.055539\ mol&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;N=n\cdot N_A=0.055539\cdot6.022\cdot10^{23}=3.344\cdot10^{22}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions there are approximately &amp;lt;math&amp;gt;3.344\cdot10^{22}&amp;lt;/math&amp;gt; molecules in 1 mL water.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;n=\frac{N}{N_A}=\frac{10,000}{6.022\cdot10^{23}}=1.6606\cdot10^{-20}\ mol&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;m=M\cdot n=18\cdot1.6606\cdot10^{-20}=2.9890\cdot10^{-19}\ g &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;V=\frac{m}{\rho}=\frac{2.9890\cdot10^{-19}\ }{0.9997\ }=2.9899\cdot10^{-19}\ mL &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At standard conditions, 10,000 water molecules take up a volume of &amp;lt;math&amp;gt;2.9899\cdot10^{-19}\ mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, the atom would be outside the box after one timestep at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;. Applying periodic boundary conditions, results in  the atom being at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; inside the box.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;r=r^*\cdot\sigma &amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r=3.20\cdot0.34\ =1.09\ nm&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\epsilon_m=\epsilon\cdot N_A=120\ k_B\cdot N_A&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon_m=120\ \mbox {K}\cdot1.381\cdot10^{-26}\cdot6.022\cdot10^{23}=0.997\ {kJ}{mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;T=\frac{T^*\cdot\epsilon}{k_B}=1.50\cdot120\ =180 \mbox{K}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, all calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number of atoms included in the box for the simulation is large. Giving atoms random starting coordinates results in a high probability of atoms placed in separation distances smaller than their equilibrium distance. This would result to very high interaction of atom pairs, with inaccurate and extremely high Lennard-Jones potential. As a result, the simulation would not be a good representation of the system, affording inaccurate results when measuring properties.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces can make the simulation unstable and cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing &amp;lt;math&amp;gt;\left(1.07722\right)&amp;lt;/math&amp;gt; corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
[[File:Basic cubic.png|thumb|right|200px|Figure 6: Simple Cubic Lattice &amp;lt;ref name=&#039;DMa&#039;&amp;gt; Original PNGs by &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:Mav Daniel Mayer]&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:DrBob DrBob]&amp;lt;/span&amp;gt;&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
[[File:FCCks5214.png|thumb|right|200px|Figure 7: Face Centered Cubic Lattice &amp;lt;ref name=&#039;DMa&#039;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Number density,ρ is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{n}{V}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Volume, V can be calculated from the lattice spacing according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;V=x^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There is 1 lattice point per unit cell as seen from Figure 6 since &amp;lt;math&amp;gt;\left(8\cdot\frac{1}{8}=1\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;br/&amp;gt;The number density in a simple cubic lattice with side length x=1.07722 is therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{n}{x^3}=\frac{1}{1.07722^3}=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;In a fcc lattice (Figure 7) there are 4 lattice points per unit cell &amp;lt;math&amp;gt;\left(6\cdot \frac{1}{2}+8\cdot \frac{1}{8}=4\right)&amp;lt;/math&amp;gt;.&amp;lt;br/&amp;gt;&lt;br /&gt;
This can be re-written as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\sqrt[3]{\frac{n}{\rho}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Using ρ=1.2 affords:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\sqrt[3]{\frac{4}{1.2}}=1.49&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As aforementioned there are four lattice points per unit cell in the face-centered cubic lattice, therefore the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&amp;lt;/pre&amp;gt;&lt;br /&gt;
would give four times the number of atoms, therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;4\cdot10\cdot10\cdot10=4000&amp;lt;/math&amp;gt; atoms&lt;br /&gt;
&lt;br /&gt;
===Setting the Properties of the Atoms===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mass 1 1.0&amp;lt;/code&amp;gt; Sets the mass of all atoms of type &#039;1&#039; to 1.0.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;pair_style lj/cut 3.0&amp;lt;/code&amp;gt; Defines the interaction between atom pairs (pairwise interaction). In this case specifically, a Lennard-Jones potential will be used for a specific distance of 3.0 reduced units. The cut-off point is an approximation made when running the simulation, however 3.0 reduced units is considered a good approximation because the Lennard-Jones potential decreases rapidly with increasing distance. If no cut-off distance was defined, an infinite number of atomic interactions would need to be taken into account and computed in the periodic boundary conditions used in this investigation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/code&amp;gt; defines the pairwise force field coefficients for all types of atoms (Note the use of asterisk (*) instead of specifying atom type(s). This is a wildcard including all atom types) in the simulation. In this case the coefficients are all 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying both the position and the velocity suggests the need of an algorithm that includes both. Therefore the Velocity-Verlet algorith will be used starting with position and velocity at time 0.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the &#039;timestep&#039; and &#039;n_steps&#039; variables and linking them in the code, speeds up the process when needing to change the timestep of the simulation. If this was not done, the whole code would need to be changed when changing the conditions of the simulation. It is worth noting that the total simulated time remain constant ensuring the generation of comparable results when changing simulation conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables means the same script can be easily adapted to run a number of different simulations, with less chance of making mistakes.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Energy Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 8. Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:Temp Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 9. Temperature against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:Pressure Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 10. Pressure against Time, for timestep=0.001]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Looking at Figure 8-10 above, equilibrium is reached for all three, total energy, temperature and pressure. &lt;br /&gt;
To investigate when the equilibrium is reached, a closer view of the graphs is needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:ZOOM Energy Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 11. Zoomed In: Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:ZOOM Pressure Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 12. Zoomed In: Temperature against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:ZOOM Temp Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 13. Zoomed In: Pressure against Time, for timestep=0.001]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The average total energy at equilibrium is -3.184   and it is reached after 0.40 reduced units of time.&lt;br /&gt;
The average temperature at equilibrium is around 1.24 and it is reached after 0.25 reduced units of time. &lt;br /&gt;
The average pressure at equilibrium is around 2.5 reduced units and it is reached after  approximately 0.30  reduced units of time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ranging the timestep as aforementioned gives representations of different accuracy of the physical properties. Shorter timesteps, run for less total time but increase the accuracy of the physical data. Looking at Figure 14 it is clear that all timesteps with the exception of 0.015 equilibrate giving a relatively constant total energy. The timestep of 0.015 does not reach equilibrium and it is therefore a bad choice of a timestep as it would not provide meaningful and representative results. &lt;br /&gt;
Timestep of 0.0025 and 0.001 give roughly the same total energy and all larger timesteps provide deviation from it. Timestep of 0.0025 is the largest timestep to give representantive and accurate results. Using timestep of 0.0025 rather than a timestep of 0.001 provides longer time frames for simulation without affecting the results&#039; accuracy.&lt;br /&gt;
Timesteps of larger value such as 0.0075 and 0.01, whilst they equilibrate, they do at a higher total energy with greater fluctuations around the mean value.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time for all Timesteps ks5214.GIF|thumb|700px|center|‎Figure 14. Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  The average total energy should not depend on the timestep so 0.01 and 0.0075 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Looking at the average pressure as the section above, pressures of p=2.4 and p=2.6 were chosen. The timestep was set to 0.0025 as this proved to give the best results and the temperatures were set to 1.5, 2.0, 2.5, 3.0 and 3.5.&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To derive an equation for γ, first the velocity is multiplied by γ (ensures that fluctuations &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; are taken into account for each time step), then the two functions are added together:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 + \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2= \frac{3}{2} N k_B T + \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)\frac{1}{2}\sum_i m_i v_i^2 = \left(T+\mathfrak{T}\right)\frac{3}{2} N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)\sum_i m_i v_i^2 = \left(T+\mathfrak{T}\right)3 N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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; we can rewrite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)3N k_B T = \left(T+\mathfrak{T}\right)3 N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)T = \left(T+\mathfrak{T}\right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \left(\frac{T+\mathfrak{T}}{T}\right)-1&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = 1+ \left(\frac{\mathfrak{T}}{T}\right)-1&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 =\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number, &amp;lt;pre&amp;gt;100&amp;lt;/pre&amp;gt; says that a sample should be calculated every 100 timesteps in order to get an average value. The second number, &amp;lt;pre&amp;gt;1000 &amp;lt;/pre&amp;gt; says that this needs to be done 1000 1000 times. The average will thus cover &amp;lt;pre&amp;gt;10,000&amp;lt;/pre&amp;gt; timesteps which is the third number.&lt;br /&gt;
Our simulation consisting of 10,000 atoms, we will have 1 average value for every 100th time step calculated contributing to the average.&lt;br /&gt;
&lt;br /&gt;
The line &amp;lt;pre&amp;gt; run 100000&amp;lt;/pre&amp;gt; states that 100000 calculations should be run. Since our timestep is of 0.0025, this would be 250 reduced time units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average will cover 100,000 timesteps, not 10,000.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen starting at the critical temperature of 1.5 reduced units and then at 2.0, 2.5, 3.0 and 3.5. &lt;br /&gt;
&lt;br /&gt;
Pressures were chosen according to the average pressures acquired from the simulations above at p=2.4 and p=2.6. &lt;br /&gt;
&lt;br /&gt;
The densities predicted by the ideal gas law at each of the pressures were calculated using the ideal gas law: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt; &amp;lt;math&amp;gt; PV=nRT &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can be rewritten using density: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt; PM=dRT &amp;lt;/math&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which rearranges to: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\frac{PM}{RT}=d&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P (pressure) was decided according to the parameter set (i.e. 2.4 or 2.6), M (molar mass) was set to 0.1, R is the universal gas constant and T (temperature) was also determined from the preset parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Remember that we are working in reduced units, you don&#039;t need the gas constant in this case (R = 1).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temp at p 2.4 and p 2.6.PNG|thumb|700px|center|‎Figure 15. Density vs Temperature]]&lt;br /&gt;
&lt;br /&gt;
As seen from Figure 15, the simulated density is lower than the ideal gas density at each given temperature and pressure. &lt;br /&gt;
To explain this, the approximations taken into account when the simulation were computed and when the ideal gas equation is used need to be investigated. The ideal gas assumes no particle-particle interaction which means that when two particles are in close proximity there is not effect on the potential energy. However this is not the case for the simulation used as the repulsive term in the Lennard Jones potential does indeed cause an increase in the potential energy when particles are close together, representing the repulsive interactions. This leads to particles of the simulation to be &amp;quot;repelled&amp;quot; from each other and to maintain a minimum distance between them. This leads to the density of the simulated system to therefore be lower than that of the ideal gas. Additionally, it is clear that for higher pressures (p=2.6) and for lower temperatures, the difference between the simulation and the ideal gas calculation. This is due to the fat that at higher temperatures and lower pressures the system behaves more like an ideal gas as it minimizes particle interaction and thus potential energy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the ideal gas is a good approximation to a dilute gas (low pressure, high temperature) when inter particle interactions are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cvv vs Temp Graph.PNG|thumb|700px|center|‎Figure 16.Heat Capacity vs Temperature at Densities 0.2, 0.8 and 1.2]]&lt;br /&gt;
&lt;br /&gt;
As seen from the equation below, specific heat capacity is temperature dependent. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the heat capacities per volume against temperature, it seems to follow a fourth order polynomial fit. A higher density, namely of 1.2 was tested to see if the trend exists regardless of density. After this was confirmed an increased number of temperature samples was taken to see whether it truly fitted through a fourth order polynomial. Increase the temperature samples showed that the relationship of heat capacity per volume against temperature is not a fourth order polynomial. Thus a curve was fitted through, corresponding to the inverse relationship between increase in temperature and increase in heat capacity per volume, as explained below. &lt;br /&gt;
&lt;br /&gt;
The heat capacity shows how easy it is to excite the system to a higher energy state. For a gas, the molar heat capacity C is the heat required to increase the temperature of 1 mole of gas by 1 K.&lt;br /&gt;
Heat capacity is an extensive property and it is expected to increase with the number of atoms present. The heat capacity per volume is thus expected to increase when the number of molecules per unit volume increases, which is clearly shown by Figure 16 by the increase in heat capacity with an increase in density. &lt;br /&gt;
&lt;br /&gt;
For real gases, heat capacities increase with an increase in temperature. The trend observed here is opposite from what expected. Heat capacity per unit volume decreases with temperature. To explain this, the electronic structure for the material at study is required. However a general explanation is based on the assumption that energy levels are more closely packed with increasing energy. This increasing energy can be presented by the increase in temperature. If the energy states are more closely packed with increasing temperature then it is easier to excite the system to a higher energy, giving an inverse relationship between heat capacity and temperature. &lt;br /&gt;
&lt;br /&gt;
Another possible explanation is based on the vibrational energy of the system. At higher temperatures, the system has more vibrational energy. As a result excitation is easier making heat capacity per unit volume to decrease with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
Input File for density of 0.2, temperature of 2.4: [[File:R0224.txt]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give the equations for the functions which you have fit to the data.  Remember that these simulations are classical so there is no electronic structure in these simulations, but the heat capacity can be related to the density of energy states.  There is also no vibrational energy in these simulations are the system only contains spherical particles.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Looking at the phase diagram of the Lennard-Jones system&amp;lt;ref&amp;gt;Hansen, J.P. and Verlet, L., 1969. Phase transitions of the Lennard-Jones system. physical Review, 184(1), p.151.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt; the density value chosen for liquid was chosen as 0.8, density for solid was chosen as 1.5 and for vapour 0.01 with temperature kept constant at T=1.2. &lt;br /&gt;
Calculating the Radial Distribution Function (RDF) using VMD and plotting it for each of the three phases against r gives Figure 17 below: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gr vs r.PNG|thumb|x400px|center|Figure 17: Radial distribution function for vapour, liquid, solid and gas]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF  represents the atom density around any particle in the system. When the RDF is at 0, it means that there are no neighboring atoms in close proximity. This can be explained by the Lennard-Jones potential which was used to calculate the inter-atomic interactions in the system. For small inter-atomic distances, the potential energy is really high, making configuration with inter-atomic distance smaller than 0.9 energetically unfavorable.&lt;br /&gt;
&lt;br /&gt;
The vapour RDF (green) shows a broad peak at inter-atomic distance of 1.125 and then decreases to a constant value of 1. This behavior is explained by the lack of order in the vapour phase which means that odds of finding another atom is low, averaging the density to a constant value. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF (red) shows three broad peaks of decreasing intensity before plateauing. The difference from the vapour is due to an increased degree of order, yet due to some extend of disorder and the atoms being able to move freely compared to each other, it still averages to a single density. Long range order is thus not observed. &lt;br /&gt;
&lt;br /&gt;
The solid RDF (blue) shows sharp fluctuations of decreasing intensity throughout the inter-atomic distances studied. This can be explained by a high degree of order (both short and long range) in the fcc solid lattice. The decrease in peak intensity is due to the vibrational motion of the particles in the solid stucture. &lt;br /&gt;
The peaks of the solid RDF correspond to coordinates of points on the fcc lattice. They come at regular distance intervals, which is the length of the unit cell. &lt;br /&gt;
&lt;br /&gt;
[[File:Solid first three points.PNG|thumb|x400px|center|Figure 18: Radial distribution function for solid, zoomed-in in first region]]&lt;br /&gt;
&lt;br /&gt;
[[File:Lattice face centered cubic editd.png|thumb|x400px|center| FCC lattice (three nearest coordination sites of central atom labeled A, B and C) &amp;lt;ref&amp;gt;Original PNG from &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:Baszoetekouw Baszoetekouw]&amp;lt;/span&amp;gt;&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Lattice points A, B and C correspond to the coordinates of the first three peaks (Figure 18) and follow coordination numbers taken from the &amp;quot;long&amp;quot; plateaus in the integral graph (Figure 20).&lt;br /&gt;
&lt;br /&gt;
From the integral of the radial distribution function, seen in Figure 19 and 20 below, shows how many atoms are interacting in the same way, at a specific distance r. For example, looking at the solid integral, Figure 20, at distance 0.975 there are 12 atoms interacting, at 1.675 there were 42 and at 2.175 there were 77.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Int gr vs r.PNG|thumb|x300px|Figure 19: Integral of RDF]] &lt;br /&gt;
|[[File:Int gr vs r ZOOMED in for solid.PNG|thumb|x300px|Figure 20: Integral of RDF for solid, zoomed-in in first region]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The coordination numbers are cumulative, the second peak represents 6 atoms (18 - 12) and the third peak represents 24 (42 - 18), can you see that these numbers make sense by looking at a diagram of an fcc lattice?  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the Diffusion Coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Liquid MSD against timestep KS5214.PNG|thumb|x200px|Figure 21: MSD against Timestep for Liquid of 8000 Atoms]]&lt;br /&gt;
| [[File:Vapour MSD against timestep KS5214.PNG|thumb|x200px|Figure 22: MSD against Timestep for Vapour of 8000 Atoms]]&lt;br /&gt;
| [[File:Solid MSD against timestep KS5214.PNG|thumb|x210px|Figure 23: MSD against Timestep for Solid of 32,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated using:&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; gives the gradient of the MSD against timestep plots (Figures 21-23). However this gradient does not have the correct units as the plots are in timestep and therefore the gradient is divided by 0.002. To get the diffusion coefficient the above equation is used and thus it is divided by six. This is summarized by Figure 24 below:&lt;br /&gt;
&lt;br /&gt;
[[File:Gradient to D .PNG|thumb|x200px|center|Figure 24: Gradient to Diffusion Coefficient]]&lt;br /&gt;
&lt;br /&gt;
This results in diffusion coefficients according to: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 8K/32K Atom System&lt;br /&gt;
! Phase&lt;br /&gt;
! Gradient&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0833&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.0782&lt;br /&gt;
| 6.52&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| 9 x 10 &amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 7.5 x 10 &amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;total&amp;quot; mean standard displacement against timestep was also repeated for the files of 1,000,000 atoms and are summarized below (Figures 25-27).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Liquid MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 25: MSD against Timestep for Liquid of 1,000,000 Atoms]]&lt;br /&gt;
| [[File:Vapour MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 26: MSD against Timestep for Vapour of 1,000,000 Atoms]]&lt;br /&gt;
| [[File:Solid MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 27: MSD against Timestep for Solid of 1,000,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 1M Atom System &lt;br /&gt;
! Phase&lt;br /&gt;
! Gradient&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0833&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.037&lt;br /&gt;
| 3.083&lt;br /&gt;
|-&lt;br /&gt;
| Solid &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;
|}&lt;br /&gt;
&lt;br /&gt;
The 8K-atom system and the 1M-atom system show similar trends in the graphs. This suggests that a smaller number of atoms such as 8,000 can be used to simulate a real physical system consisting of millions of atoms.&lt;br /&gt;
&lt;br /&gt;
Looking at the liquid phases (Figures 21 and 25) there is a linear relationship between the mean squared displacement and increasing timesteps. This is as expected, as atoms move and collide randomly due the nature of particles suspended in a fluid known as pedesis (or Brownian motion). &lt;br /&gt;
&lt;br /&gt;
Looking at the vapor phases (Figures 22 and 26), initially a quadratic behavior is observed, but then the relationship is linear (after 2,500 timesteps). this shows that initially atoms do not participate in frequent collision, but instead move free through space due to large inter-atomic distance. This allows their movement (i.e. displacement) to increase linearly with time. Taking the squared displacement which is used plot the graph gives a quadratic nature to the curve. The quadratic region however is not of interest as we only focus on the system&#039;s properties once equilibration has been achieved and atoms collide. The gradient of the vapor phase was thus calculated using a linear fit on the region above 2,500 timesteps. &lt;br /&gt;
After the 2,500th timestep the same trend as for liquids is observed also due to pedesis. &lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient for vapor however were greater than those for liquid. This is also as expected as particles in the gas phase move a lot more freely that those in a liquid due to the greater number of intermolecular interactions in liquid and thus greater degree of ordering compared to gas. &lt;br /&gt;
&lt;br /&gt;
Looking at the solid phases (Figures 23 and 27), the MSD increases rapidly and then plateaus (with some fluctuations) for the remainder of the simulation giving a very low diffusion coefficient compared to liquids and gases which comes in agreement with the highly order structure of solids, and the inability of atoms to move freely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of the shape of the vapour phase MSD and the ballistic regime.  Make sure that you only fit the linear part of the MSD to get the diffusion coefficient.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the equation of the position of the harmonic oscillator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Taking the derivative gives the velocity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;v\left(t\right)=\frac{\mbox{d} x\left(t\right)}{\mbox{d} t} =-A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;v\left(t+\tau\right)=-A\omega\sin\left(\omega \left(t+\tau\right) + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting into original eqn:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infin}^{\infin}(-A\omega\sin(\omega t+\phi))\cdot (-A\omega\sin(\omega(t+\tau)+\phi)\mbox{d}t}{\int_{-\infin}^{\infin}(A^2\omega^2\ sin^2(\omega t+\phi))\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{\int_{-\infin}^{\infin}(\sin(\omega t+\phi))\cdot (\sin(\omega(t+\tau)+\phi)\mbox{d}t}{\int_{-\infin}^{\infin}\sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+sin(b)cos(a)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)={{\int_{-\infin}^{\infin}(sin(\omega t+\phi))\left[sin(\omega t +\phi)cos(\omega\tau)+cos(\omega t+\phi)sin(\omega\tau)\right]\mbox{d}t}\over{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;={\frac{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)cos(\omega\tau)+sin(\omega t+\phi)cos(\omega t+\phi)sin(\omega\tau)\mbox{d}t}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)\mbox{d}t}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{cos(\omega\tau){\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t+sin(\omega\tau){\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t}}}{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=cos(\omega\tau)+\frac{sin(\omega\tau){\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t}}{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating from &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt; means that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t} = 0 &amp;lt;/math&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Velocity vs Timestep KS5214.PNG|thumb|600px|center|Figure 28. Velocity against Time Step for Liquid and Solid VACF and Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 28, the solid shows more intense minima that also last for a longer timestep period compared to the liquid. This relates to the RDF of the liquid and solid that were seen in previous sections. In the solid system the atoms are in fixed position, and are ordered in both long and short range. Upon collision, the almost stationary atoms in the solid system change velocity greatly. &lt;br /&gt;
For the liquid phase whilst short range order exists, long range doesn&#039;t. Collisions with neighboring atoms in the liquid result in a relatively large change in velocity in the short term (therefore a minimum is observed) but due to the lack of ordering in longer range, there is no change in velocity in the long run.&lt;br /&gt;
&lt;br /&gt;
The VACF of both liquid and solid eventually goes to zero. This can be explained by repeating collisions which make velocity of atoms to become decorrelated over time as the collisions cause velocity in different directions which cancels the overall velocity to cancel out. The Harmonic Oscillator approxiamtiondoes not account for any collisions, therefore velocity does not get &amp;quot;decorrelated&amp;quot; over time and thus it never converges. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean &amp;quot;there is no change in velocity in the long run&amp;quot;?  The velocities in the solid and liquid decorrelate eventually as the VACF decays to zero.  Make sure you don&#039;t get confused between the RDF and VACF.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients, D, were caclulated using the running integral of the VACF, following conversion to reduced time units. D was calculated using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:RunningInt Timestep Liquid 8K KS5214.PNG|thumb|x200px|Figure 29: Int. VACF against Timestep for Liquid of 8000 Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Vapour 8K KS5214.PNG|thumb|x200px|Figure 30: Int. VACF against Timestep for Vapour of 8000 Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Solid 8K KS5214.PNG|thumb|x200px|Figure 31: Int. VACF against Timestep for Solid of 32,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 8K/32K Atom Systems&lt;br /&gt;
! Phase&lt;br /&gt;
! Total Summed Integral&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.2940&lt;br /&gt;
| 0.0979&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 25.34&lt;br /&gt;
| 8.45&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| -1.8 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -5.91 x 10 &amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:RunningInt Timestep Liquid 1M KS5214.PNG|thumb|x200px|Figure 32: Int. VACF against Timestep for Liquid of 1M Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Vapour 1M KS5214.PNG|thumb|x200px|Figure 33: Int. VACF against Timestep for Vapour of 1M Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Solid 1M KS5214.PNG|thumb|x200px|Figure 34: Int. VACF against Timestep for Solid of 1M Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 1M Atom Systems&lt;br /&gt;
! Phase&lt;br /&gt;
! Total Summed Integral&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.2703&lt;br /&gt;
| 0.0901&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 9.806&lt;br /&gt;
| 3.269&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| 1.36 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.548 x 10 &amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients follow the expected trend, of smallest D for the solid and largest for the gas. Qualitatively the trend is comparable to that generated from the MSD calculations above. However the quantitative values are very different. Comparing the diffusion coefficient using VACF, it is obvious that the smallest difference in D between the system sizes is that of the liquid system, indicating that these simulations work best for liquids. &lt;br /&gt;
&lt;br /&gt;
It is worth noting that a large amount of error is expected due to the use of the trapezium rule.&lt;br /&gt;
Additionally error is present in all our calculations because of the system sizes used. This is especially true for the solid and vapor phases as large discrepancies can be seen between the diffusion coefficients of the two systems. Additionally some error can be attributed to the classical approach of molecular dynamics which doesn&#039;t take into account the quantum mechanics such as the zero point energy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculating D from the VACF also relies on the integral of the VACF reaching a plateau within the simulation time, is this valid for these simulations?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:KS5214LS&amp;diff=612339</id>
		<title>Talk:Mod:KS5214LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:KS5214LS&amp;diff=612339"/>
		<updated>2017-03-28T05:42:54Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  ==Introduction to Molecular Dynamics Simulation==  Molecular Dynamics Simulations aim to describe how a set of ato...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
&lt;br /&gt;
Molecular Dynamics Simulations aim to describe how a set of atoms move over time, using classical mechanics. Whilst the simulation carried out here are of simple systems, MDS can be used to further understand complex systems such as biological systems. &lt;br /&gt;
Here the Large-scale Atomic/Molecular Massively Parallel Simulator (LAMMPS) was used in order to simulate the movement of the particles with respect to time using the velocity-Verlet algorithm. This allowed us to model the movement of atoms and extract thermodynamic properties. It also clearly portrayed the limitations of the program and the approximations used, especially when it comes to vapor and solid systems as it was proven that the approximations used provide reasonable and comparable results for liquid systems, but large discrepancies for vapor and solid phases.&lt;br /&gt;
&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of the classical harmonic oscillator as a function of time was determined using:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt; &lt;br /&gt;
with &amp;lt;math&amp;gt;A=1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1.0&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi=0.0&amp;lt;/math&amp;gt; &lt;br /&gt;
yielding an analytical solution to the position, which as seen from Figure 1 below, seems to be in agreement with the Velocity-Verlet algorithm. &lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Time vs Position KS5214.png|thumb|750px|Figure 1:Position of a classical harmonic oscillator as a function of time (timestep=0.1)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is worth noting that the velocity and acceleration of a simple harmonic oscillator oscillate with the same frequency as the position, but with shifted phases. In simple harmonic motion when the displacement is maximum the velocity is at zero and when the displacement is zero, the velocity is at maximum. The acceleration on the other hand is at maximum when the displacement is at maximum and it is at zero when displacement is at 0. &lt;br /&gt;
&lt;br /&gt;
The energy of the classical harmonic oscillator was then determined using:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;E=\frac{1}{2}mv^2+\frac{1}{2}kx^2&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
with &amp;lt;math&amp;gt;m=1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;k=1.0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x\left(t\right)&amp;lt;/math&amp;gt; affording Figure 2.&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Energy of Classical Harmonic Oscillator as a function of time ks5214.PNG|thumb|750px|Figure 2:Energy of a classical harmonic oscillator as a function of time (timestep=0.1)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result obtained (Figure 2) is a periodic motion, repeated in a sinusoidal fashion. It maintains a constant amplitude, with a range between 0.5000 and 0.499. The harmonic oscillator has a period of 6.50 (time of single oscillation) and a frequency of 0.154 (number of cycles per unit time). &lt;br /&gt;
The position at a given time, t depends on the phase, φ, which was predetermined to 0.00, giving the starting point on the sine wave, the period and frequency are determined by the size of the mass, m (m=1.00)  and the force constant, k (k=1.00) whilst the amplitude and phase are determined by the starting position, X(0) (X(0)=1.00) and velocity, V(0) (V(0)=0.00). For an ideal harmonic oscillator, the total energy would be expected to be constant therefore the simulation does not provide an ideal result. However the fluctuation is of a magnitude of 0.00149 energy units, which approximates to 0.25% of the energy therefore the error is small and the physical behavior predicted can be considered acceptable for the purposes of the experiment. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Figure 3 shows the discrepancy between the classical, analytical solution and the solution from the Velocity-Verlet algorithm. &lt;br /&gt;
Whilst Figure 1 shows an agreement between the Valocity-Verlet algorithm and the analytical calculation, Figure 3 suggest that there is a small variation between the two solutions and thus the Velocity-Verlet algorithm results to an error in the caclulation. The error is biggest for values of time that give position close to 0, and error at these points increases linearly with time according to:&lt;br /&gt;
&amp;lt;center&amp;gt; &amp;lt;math&amp;gt;\left( y= 4.18*10^{-4}\cdot t + 3.81*10^{-5}\right)&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
This linear increase in error is due to the Taylor expansion of the integral used in the Velocity-Verlet algorith.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The increase in the error is due to accumulation of error over time.  Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 3 Error Energy Maxima as a function of time.PNG|thumb|750px|Figure 3: Linear fit to Error Function Maxima|none]] &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It was found that the sinusoidal fluctuation of the energy increases with increasing timesteps. On the other hand, the absolute value of the energy decreases. &lt;br /&gt;
As aforementioned for a timestep of 0.10, the fluctuation is very small of 0.25% energy change. As the timestep increases to 0.20 and 0.30 the fluctutaions produced are 1.00% and 2.00% of energy respectively.&lt;br /&gt;
The 0.20 timestep was found to be the limiting value with fluctuations at 1.00% (figure XX) and therefore, a timestep below 0.20 has to be chosen in order to keep energy fluctuations less that 1.00%.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy when performing the simulations as energy is meant to be constant over time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 4 Energy of Classical Harmonic Oscillator as a function of time (timestep=0.2).PNG|thumb|750px|Figure 4:Energy of a classical harmonic oscillator as a function of time (timestep=0.2)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:Figure 5 Energy of Classical Harmonic Oscillator as a function of time (timestep=0.3).PNG|thumb|750px|Figure 5:Energy of a classical harmonic oscillator as a function of time (timestep=0.3)|none]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because only when the system obeys physical laws (energy conservation in this case) to a certain extent, the outputs of the simulation can be considered meaningful.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_0\right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^6}{r_{0}^6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^6}=\frac{r_{0}^{12}}{r_{0}^6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The potential energy is 0 at &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For a single particle with &amp;lt;math&amp;gt;r=r_{0}=\sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;F=-\frac{\mbox{d}\ U\left(r^N\right)}{\mbox{d}\ r}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-\frac{\mbox{d}\ \phi\left(r_0\right)}{\mbox{d}\ r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-\frac{d\left[4\epsilon \left( \frac{\sigma^{12}}{r_{0}^{12}} - \frac{\sigma^6}{r_{0}^6} \right)\right]}{\mbox{d}\ r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-24\epsilon \left( \frac{\sigma^{6}}{r_{0}^{7}} - \frac{2\cdot\sigma^{12}}{r_{0}^{13}} \right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=-24\epsilon \left( \frac{r_{0}^{6}}{r_{0}^{7}} - \frac{2\cdot r_{0}^{12}}{r_{0}^{13}} \right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{48\epsilon}{r_0} - \frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt;r=r_{0}=\sigma&amp;lt;/math&amp;gt;, the force is &amp;lt;math&amp;gt;F=\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;.&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;).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The system is at equilibrium when F=0:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;F\left(r_{eq}\right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-\frac{\mbox{d}\ \phi\left(r_{eq}\right)}{\mbox{d}\ r_{eq}}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-\frac{\mbox{d}\left[4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)\right]}{\mbox{d}\ r_{eq}}=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;-24\epsilon \left( \frac{\sigma^{6}}{r_{eq}^{7}} - \frac{2\cdot\sigma^{12}}{r_{eq}^{13}} \right)=0&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_{eq}^{7}} = 2\cdot\frac{\sigma^{12}}{r_{eq}^{13}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_{eq}^{6}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
Equilibrium separation is &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt;:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=4\epsilon \left( \frac{\sigma^{12}}{\left({\sqrt[6]2}\ \sigma\right)^{12}} - \frac{\sigma^6}{\left({\sqrt[6]2}\ \sigma\right)^6} \right)=4\epsilon \left( \frac{1}{2^{2}} - \frac{1}{2} \right)=-\epsilon&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
The well depth at &amp;lt;math&amp;gt;r_{eq}={\sqrt[6]2}\ \sigma&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;:&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mbox{d}r=\int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mbox{d}r=\int_{2}^\infty 4\left( \frac{1^{12}}{r^{12}} - \frac{1^6}{r^6} \right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_2=-2.48\cdot10^{-2}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_{2.5}=-8.18\cdot10^{-3}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\int_{3\sigma}^\infty\phi\left(r\right)\mbox{d}r=4\left(\frac{1}{5r^5}-\frac{1}{11r^{11}}\right)^\infty_3=-3.29\cdot10^{-3}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and nicely laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At standard conditions&amp;lt;ref&amp;gt;Handbook of Chemistry and Physics, 84th ed., D.R. Lide, CRC, pp. 4-94&amp;lt;/ref&amp;gt; &amp;lt;math&amp;gt;\rho=999.7\ \frac{kg}{m^3}=0.9997\ \frac{g}{mL}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Using Avogadro&#039;s number, &amp;lt;math&amp;gt;N_A=6.022\cdot10^{23} mol^{-1}&amp;lt;/math&amp;gt; and molar mass of water, &amp;lt;math&amp;gt;M_{H_{2}O}=18\ {g}{mol}^{-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;m=\frac{\rho}{V}=\frac{0.9997}{1}=0.9997\ g&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;n=\frac{m}{M}=\frac{0.9997}{18}=0.055539\ mol&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;N=n\cdot N_A=0.055539\cdot6.022\cdot10^{23}=3.344\cdot10^{22}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At standard conditions there are approximately &amp;lt;math&amp;gt;3.344\cdot10^{22}&amp;lt;/math&amp;gt; molecules in 1 mL water.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;n=\frac{N}{N_A}=\frac{10,000}{6.022\cdot10^{23}}=1.6606\cdot10^{-20}\ mol&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;m=M\cdot n=18\cdot1.6606\cdot10^{-20}=2.9890\cdot10^{-19}\ g &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt; &amp;lt;math&amp;gt;V=\frac{m}{\rho}=\frac{2.9890\cdot10^{-19}\ }{0.9997\ }=2.9899\cdot10^{-19}\ mL &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At standard conditions, 10,000 water molecules take up a volume of &amp;lt;math&amp;gt;2.9899\cdot10^{-19}\ mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, the atom would be outside the box after one timestep at position &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;. Applying periodic boundary conditions, results in  the atom being at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt; inside the box.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;r=r^*\cdot\sigma &amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;r=3.20\cdot0.34\ =1.09\ nm&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\epsilon_m=\epsilon\cdot N_A=120\ k_B\cdot N_A&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon_m=120\ \mbox {K}\cdot1.381\cdot10^{-26}\cdot6.022\cdot10^{23}=0.997\ {kJ}{mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;T=\frac{T^*\cdot\epsilon}{k_B}=1.50\cdot120\ =180 \mbox{K}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, all calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The number of atoms included in the box for the simulation is large. Giving atoms random starting coordinates results in a high probability of atoms placed in separation distances smaller than their equilibrium distance. This would result to very high interaction of atom pairs, with inaccurate and extremely high Lennard-Jones potential. As a result, the simulation would not be a good representation of the system, affording inaccurate results when measuring properties.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces can make the simulation unstable and cause it to crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing &amp;lt;math&amp;gt;\left(1.07722\right)&amp;lt;/math&amp;gt; corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
[[File:Basic cubic.png|thumb|right|200px|Figure 6: Simple Cubic Lattice &amp;lt;ref name=&#039;DMa&#039;&amp;gt; Original PNGs by &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:Mav Daniel Mayer]&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:DrBob DrBob]&amp;lt;/span&amp;gt;&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
[[File:FCCks5214.png|thumb|right|200px|Figure 7: Face Centered Cubic Lattice &amp;lt;ref name=&#039;DMa&#039;/&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Number density,ρ is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{n}{V}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Volume, V can be calculated from the lattice spacing according to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;V=x^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There is 1 lattice point per unit cell as seen from Figure 6 since &amp;lt;math&amp;gt;\left(8\cdot\frac{1}{8}=1\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&amp;lt;br/&amp;gt;The number density in a simple cubic lattice with side length x=1.07722 is therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{n}{x^3}=\frac{1}{1.07722^3}=\frac{1}{1.25}=0.8&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;In a fcc lattice (Figure 7) there are 4 lattice points per unit cell &amp;lt;math&amp;gt;\left(6\cdot \frac{1}{2}+8\cdot \frac{1}{8}=4\right)&amp;lt;/math&amp;gt;.&amp;lt;br/&amp;gt;&lt;br /&gt;
This can be re-written as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\sqrt[3]{\frac{n}{\rho}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Using ρ=1.2 affords:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x=\sqrt[3]{\frac{4}{1.2}}=1.49&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As aforementioned there are four lattice points per unit cell in the face-centered cubic lattice, therefore the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&amp;lt;/pre&amp;gt;&lt;br /&gt;
would give four times the number of atoms, therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;4\cdot10\cdot10\cdot10=4000&amp;lt;/math&amp;gt; atoms&lt;br /&gt;
&lt;br /&gt;
===Setting the Properties of the Atoms===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mass 1 1.0&amp;lt;/code&amp;gt; Sets the mass of all atoms of type &#039;1&#039; to 1.0.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;pair_style lj/cut 3.0&amp;lt;/code&amp;gt; Defines the interaction between atom pairs (pairwise interaction). In this case specifically, a Lennard-Jones potential will be used for a specific distance of 3.0 reduced units. The cut-off point is an approximation made when running the simulation, however 3.0 reduced units is considered a good approximation because the Lennard-Jones potential decreases rapidly with increasing distance. If no cut-off distance was defined, an infinite number of atomic interactions would need to be taken into account and computed in the periodic boundary conditions used in this investigation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/code&amp;gt; defines the pairwise force field coefficients for all types of atoms (Note the use of asterisk (*) instead of specifying atom type(s). This is a wildcard including all atom types) in the simulation. In this case the coefficients are all 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Specifying both the position and the velocity suggests the need of an algorithm that includes both. Therefore the Velocity-Verlet algorith will be used starting with position and velocity at time 0.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the &#039;timestep&#039; and &#039;n_steps&#039; variables and linking them in the code, speeds up the process when needing to change the timestep of the simulation. If this was not done, the whole code would need to be changed when changing the conditions of the simulation. It is worth noting that the total simulated time remain constant ensuring the generation of comparable results when changing simulation conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables means the same script can be easily adapted to run a number of different simulations, with less chance of making mistakes.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Energy Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 8. Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:Temp Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 9. Temperature against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:Pressure Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 10. Pressure against Time, for timestep=0.001]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Looking at Figure 8-10 above, equilibrium is reached for all three, total energy, temperature and pressure. &lt;br /&gt;
To investigate when the equilibrium is reached, a closer view of the graphs is needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:ZOOM Energy Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 11. Zoomed In: Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:ZOOM Pressure Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 12. Zoomed In: Temperature against Time, for timestep=0.001]]&lt;br /&gt;
| [[File:ZOOM Temp Against Time Plot KS5214 - Checking equilibration.GIF|thumb|400px|‎Figure 13. Zoomed In: Pressure against Time, for timestep=0.001]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The average total energy at equilibrium is -3.184   and it is reached after 0.40 reduced units of time.&lt;br /&gt;
The average temperature at equilibrium is around 1.24 and it is reached after 0.25 reduced units of time. &lt;br /&gt;
The average pressure at equilibrium is around 2.5 reduced units and it is reached after  approximately 0.30  reduced units of time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ranging the timestep as aforementioned gives representations of different accuracy of the physical properties. Shorter timesteps, run for less total time but increase the accuracy of the physical data. Looking at Figure 14 it is clear that all timesteps with the exception of 0.015 equilibrate giving a relatively constant total energy. The timestep of 0.015 does not reach equilibrium and it is therefore a bad choice of a timestep as it would not provide meaningful and representative results. &lt;br /&gt;
Timestep of 0.0025 and 0.001 give roughly the same total energy and all larger timesteps provide deviation from it. Timestep of 0.0025 is the largest timestep to give representantive and accurate results. Using timestep of 0.0025 rather than a timestep of 0.001 provides longer time frames for simulation without affecting the results&#039; accuracy.&lt;br /&gt;
Timesteps of larger value such as 0.0075 and 0.01, whilst they equilibrate, they do at a higher total energy with greater fluctuations around the mean value.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs Time for all Timesteps ks5214.GIF|thumb|700px|center|‎Figure 14. Total Energy against Time, for timestep=0.001]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  The average total energy should not depend on the timestep so 0.01 and 0.0075 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Looking at the average pressure as the section above, pressures of p=2.4 and p=2.6 were chosen. The timestep was set to 0.0025 as this proved to give the best results and the temperatures were set to 1.5, 2.0, 2.5, 3.0 and 3.5.&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To derive an equation for γ, first the velocity is multiplied by γ (ensures that fluctuations &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; are taken into account for each time step), then the two functions are added together:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 + \frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2= \frac{3}{2} N k_B T + \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which rearranges to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)\frac{1}{2}\sum_i m_i v_i^2 = \left(T+\mathfrak{T}\right)\frac{3}{2} N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)\sum_i m_i v_i^2 = \left(T+\mathfrak{T}\right)3 N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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; we can rewrite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)3N k_B T = \left(T+\mathfrak{T}\right)3 N k_B&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\left(1+\gamma^2\right)T = \left(T+\mathfrak{T}\right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \left(\frac{T+\mathfrak{T}}{T}\right)-1&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = 1+ \left(\frac{\mathfrak{T}}{T}\right)-1&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma^2 =\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;\gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first number, &amp;lt;pre&amp;gt;100&amp;lt;/pre&amp;gt; says that a sample should be calculated every 100 timesteps in order to get an average value. The second number, &amp;lt;pre&amp;gt;1000 &amp;lt;/pre&amp;gt; says that this needs to be done 1000 1000 times. The average will thus cover &amp;lt;pre&amp;gt;10,000&amp;lt;/pre&amp;gt; timesteps which is the third number.&lt;br /&gt;
Our simulation consisting of 10,000 atoms, we will have 1 average value for every 100th time step calculated contributing to the average.&lt;br /&gt;
&lt;br /&gt;
The line &amp;lt;pre&amp;gt; run 100000&amp;lt;/pre&amp;gt; states that 100000 calculations should be run. Since our timestep is of 0.0025, this would be 250 reduced time units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average will cover 100,000 timesteps, not 10,000.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Temperatures chosen starting at the critical temperature of 1.5 reduced units and then at 2.0, 2.5, 3.0 and 3.5. &lt;br /&gt;
&lt;br /&gt;
Pressures were chosen according to the average pressures acquired from the simulations above at p=2.4 and p=2.6. &lt;br /&gt;
&lt;br /&gt;
The densities predicted by the ideal gas law at each of the pressures were calculated using the ideal gas law: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt; &amp;lt;math&amp;gt; PV=nRT &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which can be rewritten using density: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt; PM=dRT &amp;lt;/math&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which rearranges to: &amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;\frac{PM}{RT}=d&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P (pressure) was decided according to the parameter set (i.e. 2.4 or 2.6), M (molar mass) was set to 0.1, R is the universal gas constant and T (temperature) was also determined from the preset parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Remember that we are working in reduced units, you don&#039;t need the gas constant in this case (R = 1).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temp at p 2.4 and p 2.6.PNG|thumb|700px|center|‎Figure 15. Density vs Temperature]]&lt;br /&gt;
&lt;br /&gt;
As seen from Figure 15, the simulated density is lower than the ideal gas density at each given temperature and pressure. &lt;br /&gt;
To explain this, the approximations taken into account when the simulation were computed and when the ideal gas equation is used need to be investigated. The ideal gas assumes no particle-particle interaction which means that when two particles are in close proximity there is not effect on the potential energy. However this is not the case for the simulation used as the repulsive term in the Lennard Jones potential does indeed cause an increase in the potential energy when particles are close together, representing the repulsive interactions. This leads to particles of the simulation to be &amp;quot;repelled&amp;quot; from each other and to maintain a minimum distance between them. This leads to the density of the simulated system to therefore be lower than that of the ideal gas. Additionally, it is clear that for higher pressures (p=2.6) and for lower temperatures, the difference between the simulation and the ideal gas calculation. This is due to the fat that at higher temperatures and lower pressures the system behaves more like an ideal gas as it minimizes particle interaction and thus potential energy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the ideal gas is a good approximation to a dilute gas (low pressure, high temperature) when inter particle interactions are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cvv vs Temp Graph.PNG|thumb|700px|center|‎Figure 16.Heat Capacity vs Temperature at Densities 0.2, 0.8 and 1.2]]&lt;br /&gt;
&lt;br /&gt;
As seen from the equation below, specific heat capacity is temperature dependent. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} &amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Looking at the heat capacities per volume against temperature, it seems to follow a fourth order polynomial fit. A higher density, namely of 1.2 was tested to see if the trend exists regardless of density. After this was confirmed an increased number of temperature samples was taken to see whether it truly fitted through a fourth order polynomial. Increase the temperature samples showed that the relationship of heat capacity per volume against temperature is not a fourth order polynomial. Thus a curve was fitted through, corresponding to the inverse relationship between increase in temperature and increase in heat capacity per volume, as explained below. &lt;br /&gt;
&lt;br /&gt;
The heat capacity shows how easy it is to excite the system to a higher energy state. For a gas, the molar heat capacity C is the heat required to increase the temperature of 1 mole of gas by 1 K.&lt;br /&gt;
Heat capacity is an extensive property and it is expected to increase with the number of atoms present. The heat capacity per volume is thus expected to increase when the number of molecules per unit volume increases, which is clearly shown by Figure 16 by the increase in heat capacity with an increase in density. &lt;br /&gt;
&lt;br /&gt;
For real gases, heat capacities increase with an increase in temperature. The trend observed here is opposite from what expected. Heat capacity per unit volume decreases with temperature. To explain this, the electronic structure for the material at study is required. However a general explanation is based on the assumption that energy levels are more closely packed with increasing energy. This increasing energy can be presented by the increase in temperature. If the energy states are more closely packed with increasing temperature then it is easier to excite the system to a higher energy, giving an inverse relationship between heat capacity and temperature. &lt;br /&gt;
&lt;br /&gt;
Another possible explanation is based on the vibrational energy of the system. At higher temperatures, the system has more vibrational energy. As a result excitation is easier making heat capacity per unit volume to decrease with increasing temperature.&lt;br /&gt;
&lt;br /&gt;
Input File for density of 0.2, temperature of 2.4: [[File:R0224.txt]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give the equations for the functions which you have fit to the data.  Remember that these simulations are classical so there is no electronic structure in these simulations, but the heat capacity can be related to the density of energy states.  There is also no vibrational energy in these simulations are the system only contains spherical particles.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Looking at the phase diagram of the Lennard-Jones system&amp;lt;ref&amp;gt;Hansen, J.P. and Verlet, L., 1969. Phase transitions of the Lennard-Jones system. physical Review, 184(1), p.151.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt; the density value chosen for liquid was chosen as 0.8, density for solid was chosen as 1.5 and for vapour 0.01 with temperature kept constant at T=1.2. &lt;br /&gt;
Calculating the Radial Distribution Function (RDF) using VMD and plotting it for each of the three phases against r gives Figure 17 below: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gr vs r.PNG|thumb|x400px|center|Figure 17: Radial distribution function for vapour, liquid, solid and gas]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The RDF  represents the atom density around any particle in the system. When the RDF is at 0, it means that there are no neighboring atoms in close proximity. This can be explained by the Lennard-Jones potential which was used to calculate the inter-atomic interactions in the system. For small inter-atomic distances, the potential energy is really high, making configuration with inter-atomic distance smaller than 0.9 energetically unfavorable.&lt;br /&gt;
&lt;br /&gt;
The vapour RDF (green) shows a broad peak at inter-atomic distance of 1.125 and then decreases to a constant value of 1. This behavior is explained by the lack of order in the vapour phase which means that odds of finding another atom is low, averaging the density to a constant value. &lt;br /&gt;
&lt;br /&gt;
The liquid RDF (red) shows three broad peaks of decreasing intensity before plateauing. The difference from the vapour is due to an increased degree of order, yet due to some extend of disorder and the atoms being able to move freely compared to each other, it still averages to a single density. Long range order is thus not observed. &lt;br /&gt;
&lt;br /&gt;
The solid RDF (blue) shows sharp fluctuations of decreasing intensity throughout the inter-atomic distances studied. This can be explained by a high degree of order (both short and long range) in the fcc solid lattice. The decrease in peak intensity is due to the vibrational motion of the particles in the solid stucture. &lt;br /&gt;
The peaks of the solid RDF correspond to coordinates of points on the fcc lattice. They come at regular distance intervals, which is the length of the unit cell. &lt;br /&gt;
&lt;br /&gt;
[[File:Solid first three points.PNG|thumb|x400px|center|Figure 18: Radial distribution function for solid, zoomed-in in first region]]&lt;br /&gt;
&lt;br /&gt;
[[File:Lattice face centered cubic editd.png|thumb|x400px|center| FCC lattice (three nearest coordination sites of central atom labeled A, B and C) &amp;lt;ref&amp;gt;Original PNG from &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://en.wikipedia.org/wiki/User:Baszoetekouw Baszoetekouw]&amp;lt;/span&amp;gt;&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Lattice points A, B and C correspond to the coordinates of the first three peaks (Figure 18) and follow coordination numbers taken from the &amp;quot;long&amp;quot; plateaus in the integral graph (Figure 20).&lt;br /&gt;
&lt;br /&gt;
From the integral of the radial distribution function, seen in Figure 19 and 20 below, shows how many atoms are interacting in the same way, at a specific distance r. For example, looking at the solid integral, Figure 20, at distance 0.975 there are 12 atoms interacting, at 1.675 there were 42 and at 2.175 there were 77.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Int gr vs r.PNG|thumb|x300px|Figure 19: Integral of RDF]] &lt;br /&gt;
|[[File:Int gr vs r ZOOMED in for solid.PNG|thumb|x300px|Figure 20: Integral of RDF for solid, zoomed-in in first region]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the Diffusion Coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Liquid MSD against timestep KS5214.PNG|thumb|x200px|Figure 21: MSD against Timestep for Liquid of 8000 Atoms]]&lt;br /&gt;
| [[File:Vapour MSD against timestep KS5214.PNG|thumb|x200px|Figure 22: MSD against Timestep for Vapour of 8000 Atoms]]&lt;br /&gt;
| [[File:Solid MSD against timestep KS5214.PNG|thumb|x210px|Figure 23: MSD against Timestep for Solid of 32,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients were calculated using:&lt;br /&gt;
&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;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; gives the gradient of the MSD against timestep plots (Figures 21-23). However this gradient does not have the correct units as the plots are in timestep and therefore the gradient is divided by 0.002. To get the diffusion coefficient the above equation is used and thus it is divided by six. This is summarized by Figure 24 below:&lt;br /&gt;
&lt;br /&gt;
[[File:Gradient to D .PNG|thumb|x200px|center|Figure 24: Gradient to Diffusion Coefficient]]&lt;br /&gt;
&lt;br /&gt;
This results in diffusion coefficients according to: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 8K/32K Atom System&lt;br /&gt;
! Phase&lt;br /&gt;
! Gradient&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0833&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.0782&lt;br /&gt;
| 6.52&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| 9 x 10 &amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 7.5 x 10 &amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;total&amp;quot; mean standard displacement against timestep was also repeated for the files of 1,000,000 atoms and are summarized below (Figures 25-27).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Liquid MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 25: MSD against Timestep for Liquid of 1,000,000 Atoms]]&lt;br /&gt;
| [[File:Vapour MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 26: MSD against Timestep for Vapour of 1,000,000 Atoms]]&lt;br /&gt;
| [[File:Solid MSD against timestep 1M KS5214.PNG|thumb|x200px|Figure 27: MSD against Timestep for Solid of 1,000,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 1M Atom System &lt;br /&gt;
! Phase&lt;br /&gt;
! Gradient&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0833&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 0.037&lt;br /&gt;
| 3.083&lt;br /&gt;
|-&lt;br /&gt;
| Solid &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;
|}&lt;br /&gt;
&lt;br /&gt;
The 8K-atom system and the 1M-atom system show similar trends in the graphs. This suggests that a smaller number of atoms such as 8,000 can be used to simulate a real physical system consisting of millions of atoms.&lt;br /&gt;
&lt;br /&gt;
Looking at the liquid phases (Figures 21 and 25) there is a linear relationship between the mean squared displacement and increasing timesteps. This is as expected, as atoms move and collide randomly due the nature of particles suspended in a fluid known as pedesis (or Brownian motion). &lt;br /&gt;
&lt;br /&gt;
Looking at the vapor phases (Figures 22 and 26), initially a quadratic behavior is observed, but then the relationship is linear (after 2,500 timesteps). this shows that initially atoms do not participate in frequent collision, but instead move free through space due to large inter-atomic distance. This allows their movement (i.e. displacement) to increase linearly with time. Taking the squared displacement which is used plot the graph gives a quadratic nature to the curve. The quadratic region however is not of interest as we only focus on the system&#039;s properties once equilibration has been achieved and atoms collide. The gradient of the vapor phase was thus calculated using a linear fit on the region above 2,500 timesteps. &lt;br /&gt;
After the 2,500th timestep the same trend as for liquids is observed also due to pedesis. &lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient for vapor however were greater than those for liquid. This is also as expected as particles in the gas phase move a lot more freely that those in a liquid due to the greater number of intermolecular interactions in liquid and thus greater degree of ordering compared to gas. &lt;br /&gt;
&lt;br /&gt;
Looking at the solid phases (Figures 23 and 27), the MSD increases rapidly and then plateaus (with some fluctuations) for the remainder of the simulation giving a very low diffusion coefficient compared to liquids and gases which comes in agreement with the highly order structure of solids, and the inability of atoms to move freely.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the equation of the position of the harmonic oscillator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Taking the derivative gives the velocity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;v\left(t\right)=\frac{\mbox{d} x\left(t\right)}{\mbox{d} t} =-A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;v\left(t+\tau\right)=-A\omega\sin\left(\omega \left(t+\tau\right) + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting into original eqn:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infin}^{\infin}(-A\omega\sin(\omega t+\phi))\cdot (-A\omega\sin(\omega(t+\tau)+\phi)\mbox{d}t}{\int_{-\infin}^{\infin}(A^2\omega^2\ sin^2(\omega t+\phi))\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{\int_{-\infin}^{\infin}(\sin(\omega t+\phi))\cdot (\sin(\omega(t+\tau)+\phi)\mbox{d}t}{\int_{-\infin}^{\infin}\sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(a+b)=sin(a)cos(b)+sin(b)cos(a)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
It can be written:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)={{\int_{-\infin}^{\infin}(sin(\omega t+\phi))\left[sin(\omega t +\phi)cos(\omega\tau)+cos(\omega t+\phi)sin(\omega\tau)\right]\mbox{d}t}\over{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;={\frac{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)cos(\omega\tau)+sin(\omega t+\phi)cos(\omega t+\phi)sin(\omega\tau)\mbox{d}t}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)\mbox{d}t}}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=\frac{cos(\omega\tau){\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t+sin(\omega\tau){\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t}}}{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;=cos(\omega\tau)+\frac{sin(\omega\tau){\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t}}{\int_{-\infin}^{\infin}sin^2(\omega t+\phi)\mbox{d}t}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrating from &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt; means that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;{\int_{-\infin}^{\infin}sin(\omega t+\phi) cos(\omega t+\phi)\mbox{d}t} = 0 &amp;lt;/math&amp;gt; &amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega\tau)&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Velocity vs Timestep KS5214.PNG|thumb|600px|center|Figure 28. Velocity against Time Step for Liquid and Solid VACF and Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
Looking at Figure 28, the solid shows more intense minima that also last for a longer timestep period compared to the liquid. This relates to the RDF of the liquid and solid that were seen in previous sections. In the solid system the atoms are in fixed position, and are ordered in both long and short range. Upon collision, the almost stationary atoms in the solid system change velocity greatly. &lt;br /&gt;
For the liquid phase whilst short range order exists, long range doesn&#039;t. Collisions with neighboring atoms in the liquid result in a relatively large change in velocity in the short term (therefore a minimum is observed) but due to the lack of ordering in longer range, there is no change in velocity in the long run.&lt;br /&gt;
&lt;br /&gt;
The VACF of both liquid and solid eventually goes to zero. This can be explained by repeating collisions which make velocity of atoms to become decorrelated over time as the collisions cause velocity in different directions which cancels the overall velocity to cancel out. The Harmonic Oscillator approxiamtiondoes not account for any collisions, therefore velocity does not get &amp;quot;decorrelated&amp;quot; over time and thus it never converges. &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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trapezium rule is defined as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx (b-a) \left[\frac{f(a) + f(b)}{2} \right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients, D, were caclulated using the running integral of the VACF, following conversion to reduced time units. D was calculated using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:RunningInt Timestep Liquid 8K KS5214.PNG|thumb|x200px|Figure 29: Int. VACF against Timestep for Liquid of 8000 Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Vapour 8K KS5214.PNG|thumb|x200px|Figure 30: Int. VACF against Timestep for Vapour of 8000 Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Solid 8K KS5214.PNG|thumb|x200px|Figure 31: Int. VACF against Timestep for Solid of 32,000 Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 8K/32K Atom Systems&lt;br /&gt;
! Phase&lt;br /&gt;
! Total Summed Integral&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.2940&lt;br /&gt;
| 0.0979&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 25.34&lt;br /&gt;
| 8.45&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| -1.8 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| -5.91 x 10 &amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot; style=&amp;quot;width: auto; margin-left: auto; margin-right: auto;&amp;quot;&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[File:RunningInt Timestep Liquid 1M KS5214.PNG|thumb|x200px|Figure 32: Int. VACF against Timestep for Liquid of 1M Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Vapour 1M KS5214.PNG|thumb|x200px|Figure 33: Int. VACF against Timestep for Vapour of 1M Atoms]]&lt;br /&gt;
| [[File:RunningInt Timestep Solid 1M KS5214.PNG|thumb|x200px|Figure 34: Int. VACF against Timestep for Solid of 1M Atoms]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficient Summary for 1M Atom Systems&lt;br /&gt;
! Phase&lt;br /&gt;
! Total Summed Integral&lt;br /&gt;
! Diffusion Coefficient &lt;br /&gt;
|-&lt;br /&gt;
| Liquid&lt;br /&gt;
| 0.2703&lt;br /&gt;
| 0.0901&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Vapour&lt;br /&gt;
| 9.806&lt;br /&gt;
| 3.269&lt;br /&gt;
|-&lt;br /&gt;
| Solid &lt;br /&gt;
| 1.36 x 10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 4.548 x 10 &amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients follow the expected trend, of smallest D for the solid and largest for the gas. Qualitatively the trend is comparable to that generated from the MSD calculations above. However the quantitative values are very different. Comparing the diffusion coefficient using VACF, it is obvious that the smallest difference in D between the system sizes is that of the liquid system, indicating that these simulations work best for liquids. &lt;br /&gt;
&lt;br /&gt;
It is worth noting that a large amount of error is expected due to the use of the trapezium rule.&lt;br /&gt;
Additionally error is present in all our calculations because of the system sizes used. This is especially true for the solid and vapor phases as large discrepancies can be seen between the diffusion coefficients of the two systems. Additionally some error can be attributed to the classical approach of molecular dynamics which doesn&#039;t take into account the quantum mechanics such as the zero point energy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:LiquidSim:Sid220217&amp;diff=612338</id>
		<title>Talk:LiquidSim:Sid220217</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:LiquidSim:Sid220217&amp;diff=612338"/>
		<updated>2017-03-28T05:05:27Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report, all tasks answered and results look good.  Try to make your written explanations a bit more focused and specific to the question being asked .&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Introduction to Molecular Dynamics Simulation =&lt;br /&gt;
== Numerical Integration ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exact analytical solutions for the atomic position can only be found in simple systems such as the classic harmonic oscillator. For many-body systems with chaotic dynamics, numerical integration methods such as the velocity-Verlet algorithm are necessary, and only an approximation can be made for the atomic position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
On the chart below, both the classic harmonic oscillator solution and the velocity-Verlet algorithm are shown, with the classical result, &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; using the values of &amp;lt;math&amp;gt;A=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntAnalytical2.JPG|centre|frame| &#039;&#039;&#039;Displacement as a function of time, &amp;quot;ANALYTICAL&amp;quot; being the classical solution and &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; the velocity-Verlet algorithm&#039;&#039;&#039;]] &lt;br /&gt;
&lt;br /&gt;
The total energy for the velocity-Verlet solution is a sum of the potential and kinetic energy components, &amp;lt;math&amp;gt;E=U+K&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;U=\frac{1} {2}kx^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V=\frac{1} {2}mv^2&amp;lt;/math&amp;gt;, and values of &amp;lt;math&amp;gt;k=m=1&amp;lt;/math&amp;gt; are used. (Remember that &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v\left(t\right)&amp;lt;/math&amp;gt; are obtained from the velocity-Verlet algorithm.)&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntEnergy2.JPG|centre|frame|&#039;&#039;&#039;Energy as a function of time&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The absolute difference between the classic harmonic oscillator solution and the velocity-Verlet Algorithm for the atomic position is given below, with an additional line plotted through the estimated error maxima.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntErrorMaxima3.JPG|centre|frame| &#039;&#039;&#039;Absolute error between the classical solution and the velocity-Verlet Solution&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As the timestep is increased from 0.1, the amplitude and frequency of the total energy for the velocity-Verlet solution is increased (greater and more frequent fluctuations), as the  &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v\left(t\right)&amp;lt;/math&amp;gt; approximations obtained from the numerical-integration are now weaker as &amp;lt;math&amp;gt;\partial t&amp;lt;/math&amp;gt; is greater. The total energy does not fluctuate by more than 1% (0.005) when a timestep of 0.2 is used - the plot of the energy using this timestep is given below. When modelling a physical system numerically as done here, it is important to monitor the total energy throughout the simulation to check if it stays constant, as the simulation should obey the law of conservation of energy, that energy cannot be created or destroyed - only transformed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
[[File:NumericalIntTimestep.JPG|centre|frame|&#039;&#039;&#039;Energy as a function of time using the timestep 0.2, where the energy does not fluctuate by more than 1%&#039;&#039;&#039; ]]&lt;br /&gt;
&lt;br /&gt;
== Atomic Forces ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The force at this separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The well depth&#039;&#039;&#039; (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r_0\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \sigma^6 - r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0^6 = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remembering &amp;lt;math&amp;gt;\phi\left(r_0\right) = 4\epsilon \left( \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -4\epsilon \left( -12\frac{\sigma^{12}} {r_0^{13}} + 6\frac{\sigma^6} {r_0^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = 48\epsilon\frac{\sigma^{12}} {r_0^{13}} - 24\frac{\sigma^6} {r_0^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{48\epsilon} {\sigma} - \frac{24\epsilon} {\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon} {\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|A system is in equilibrium when the net force acting on it is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;48\epsilon\frac{\sigma^{12}} {r_{eq}^{13}} - 24\frac{\sigma^6} {r_{eq}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;48\epsilon\frac{\sigma^{12}} {r_{eq}^{13}} = 24\frac{\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} = 2^{1/6}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}} {r_{eq}^{12}} - \frac{\sigma^6} {r_{eq}^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r_{eq} = 2^{1/6}\sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}} {\left(2^{1/6}\sigma\right)^{12}} - \frac{\sigma^6} {\left(2^{1/6}\sigma\right)^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1} {4} - \frac{1} {2}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(-\frac{1} {4}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{2\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(2\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(2\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(2\right)^{11}} + \frac{1} {5\left(2\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{2.5\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(2.5\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(2.5\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(2.5\right)^{11}} + \frac{1} {5\left(2.5\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{3\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(3\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(3\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(3\right)^{11}} + \frac{1} {5\left(3\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Estimation of the number of water molecules in 1 mL under standard conditions&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Estimation of the volume of 10000 water molecules under standard conditions&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;\rho_{H_2O} = 0.9982 g  mL^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of &amp;lt;math&amp;gt;{H_2O}&amp;lt;/math&amp;gt; in 1 mL =&amp;lt;math&amp;gt;\rho\times V = 1 gmL^{-1}\times 1 mL = 0.9982g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Molar mass of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;18.0153gmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of moles of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; in 1mL = &amp;lt;math&amp;gt;\frac{m} {M_r}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{0.9982g} {18.0153gmol^{-1}} = 0.05540845837mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules in 1mL = &amp;lt;math&amp;gt;n\times N_A&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.05540845837mol\times 6.022\times 10^{23}mol^{-1} = 3.3\times10^{22}molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
Number of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules in moles = &amp;lt;math&amp;gt;\frac{N} {N_A}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{10000} {6.022\times 10^{23}mol^{-1}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.660577881\times 10^{-20}mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules = &amp;lt;math&amp;gt;n\times M_r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;1.660577881\times 10^{-20}mol\times 18.0153gmol^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
= &amp;lt;math&amp;gt;2.99158087\times 10^{-19}g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules = &amp;lt;math&amp;gt;\frac{m} {\rho}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{2.99158087\times 10^{-19}g} {0.9982gmL^{-1}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.00\times 10^{-19}mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The new position of the atom in a cubic simulation box that 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; is:&lt;br /&gt;
 &amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right)&amp;lt;/math&amp;gt; + &amp;lt;math&amp;gt;\left(0.7,0.6,0.2\right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt; after the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units?&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^*\times \sigma = 3.2\times 0.34\times 10^{-9} = 1.088\times 10^{-9}m = 1.088nm&amp;lt;/math&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon} {k_B}= 120 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120\mathrm{K} = 1.381\times 10^{-23}JK^{-1}\times 120\mathrm{K} = 1.6572\times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\epsilon = \frac{1.6572\times 10^{-21}J\times 6.022\times 10^{23}mol^{-1}} {1000}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.998\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;  &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = \frac{1.5\times \epsilon} {k_B} = \frac{1.5\times 1.6572\times 10^{-21}J} {1.381\times 10^{-23}JK^{-1}} = 180\mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibration =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are given random starting coordinates, it is possible the atoms could be in the repulsive regime of the Lennard-Jones Potential, as well as virtually on top of each other(superimposed), which is physically impossible. The small values of the separation r that could be randomly generated also give rise to unrealistic potential energies &amp;lt;math&amp;gt;\phi_r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The problem with very large repulsive energies is that the simulation becomes unstable and can crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Proof that a lattice spacing of 1.07722 in a simple cubic unit cell corresponds to a lattice point number density of 0.8&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the side length of a face centred cubic unit cell when the lattice point number density is 1.2&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Volume occupied by 1 simple cubic unit cell = &amp;lt;math&amp;gt;1.0772^3&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.24993962&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is 1 lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
Therefore 1 lattice point occupies a volume of 1.24993962.&lt;br /&gt;
&lt;br /&gt;
Lattice point number density = (Unit Volume / Volume occupied by 1 lattice point)&amp;lt;math&amp;gt;\times&amp;lt;/math&amp;gt; No&#039; of lattice points in unit cell = &amp;lt;math&amp;gt;\frac{1} {1.249939632}\times 1&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
Lattice point number density = (Unit Volume / Volume occupied by 1 lattice point)&amp;lt;math&amp;gt;\times&amp;lt;/math&amp;gt; No&#039; of lattice points in unit cell&lt;br /&gt;
&lt;br /&gt;
There are 4 lattice points in a FCC unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = 4\times \frac{1} {V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V =\frac{4} {1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Side length of unit cell =&amp;lt;math&amp;gt;\left(\frac{4} {1.2}\right)^{1/3} = 1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the initial lattice commands in the input file had &#039;&#039; lattice fcc&#039;&#039; written instead of &#039;&#039; lattice sc&#039;&#039; 4000 atoms would be created, as there are 4 lattice points per FCC unit cell, and the simulation has been instructed in the succeeding script to run as a box made from (10x10x10) unit cells.&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output log file from the simulation will contain the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Created 4000 atoms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| This command defines the mass for all atoms, of all types, that will be used in the simulation. In this particular instance, the command instructs that  all atoms of type 1 in this simulation, will have a mass of 1.0; the first number defining the atom type, and the second the mass in reduced units.&lt;br /&gt;
| This command tells LAMMPS how to compute the interaction energies in the simulation by defining the type of interactions between pairs of atoms, and the distance in which these types of interactions can exist in &#039;&#039;(the cut-off distance).&#039;&#039; All other possible pairwise interactions that are not mentioned in this command are ignored by LAMMPS, as well as &#039;long range&#039; interactions of the specified type (interactions that exceed the cut off distance), making the computation easier. In the command written here, it is instructed that in this simulation there will be a Lennard-Jones potential between pairs of atoms that are within a distance of 3.0 of each other.&lt;br /&gt;
| The pairwise force field coefficient is another predefined property required by LAMMPS to compute the energy in the simulation. The number and meaning of the coefficients depends on the pair style. The script &#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039; means that the pairwise forcefield coefficient between all types of atoms is 1.0. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for a Lennard-Jones potential and why is a cutoff used?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As we are defining the initial position and velocity, we are using the velocity-Verlet algorithm for this integration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the second script, the script writer will have to calculate the required number of simulation runs by his or herself, and input this value every time the timestep is changed, in order to keep the total simulation time constant. The first script is the more useful script to use, because it allows the script writer to leave the mathematics to LAMMPS, which automatically adjusts the number of simulation runs when the timestep is changed through the variable &#039;&#039;n_steps&#039;&#039;, to keep the total simulation time constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, variables make it easy to change simulation parameters and limit the changes of makings mistakes.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy,pressure and temp vs time.PNG|centre|frame| &#039;&#039;&#039;Plots of Energy, Temperature and Pressure vs Time respectively using a Timestep of 0.001&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The plots above do show that equilibrium has been reached, as the energy minimizes and reaches a value around which it fluctuates and at the same time, temperature and pressure maximise and reach a value around which they fluctuate. The time at which this occurs, (approximately 0.4) is the point of equilibration. The synchronized timing of energy and temperature reaching a fluctuating value in particular is an indicator of equilibration, as it implies fulfillment of the Clausius inequality for the Helmholtz free energy, dA=0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:AllTimesteps.JPG|centre|frame|&#039;&#039;&#039;Energy vs Time for all Timesteps&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The timestep that minimizes the energy to the lowest value within the set simulation time (100) is the most accurate, as the lower the energy value in the simulation, the closer the simulation is to physical reality. Therefore, it can be seen from the plots above that simulation accuracy increases with timestep shortening. However, with shorter timesteps, computing the simulation takes longer, therefore a compromise is logical. In the graph above, as the plot for the 0.0025 timestep is almost superimposed on the 0.001 timestep plot (the shortest timestep and lowest energy output), it is feasible to say that 0.0025 is the largest timestep to give acceptable results. 0.015 is a particularly bad choice as the energy output from this timestep never actually reaches a fluctuating value within the set simulation time, and most importantly is continuously &#039;&#039;increasing&#039;&#039; not &#039;&#039;decreasing&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the length of the timestep and to make the simulations efficient you should choose the largest timestep that agrees with this.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Running Simulations under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Temperatures of 1.75, 2.0, 2.25, 2.5 and 2.75 and pressures of 2.6 and 2.8 were chosen. The pressures chosen were based around the average value for equilibration found in the previous section of this report (approximately 2.6). The timestep chosen for all these simulations was 0.0025, based also on the findings in the previous section of this report, of looking for a balance between accuracy of results and time taken for computation when choosing a timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&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;\sum_i m_i v_i^2 = 3 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;
&amp;lt;math&amp;gt;\left(\frac{\gamma^2}{2}\right)\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(\frac{\gamma^2}{2}\right)3 N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \plusmn\sqrt{\frac{\mathfrak{T}} {T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three numbers &#039;&#039;100 1000 100000&#039;&#039; represent the three arguments &#039;&#039;Nevery Nrepeat Nfreq&#039;&#039; which specify on what timesteps the input values of the simulation will be used to used to contribute to the final average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100&#039;&#039; i.e. &#039;&#039;Nevery&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number specifies the jump between timesteps used to compute the time average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000&#039;&#039; i.e. &#039;&#039;Nrepeat&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number specifies the number of timesteps used to compute the time average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100000 &#039;&#039; i.e. &#039;&#039;Nfreq&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number defines how often time averages will be taken.&lt;br /&gt;
&lt;br /&gt;
Therefore every 100 timesteps, values of properties such as temperature and pressure will be sampled, and a 1000 measurements will contribute to the average. As the average will be calculated after 100000 timesteps, and the timestep being used is 0.0025, the time the simulation will run for is 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
[[File: EqofState2.JPG|centre|frame|&#039;&#039;&#039;Simulation Density Output vs Ideal Gas Law Density Output&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density generated from the Ideal Gas Law, as the Ideal Gas Law ignores any interactions between atoms. Therefore as there are no repulsive forces according to the Ideal Gas Law, the atoms can get in very close proximity to each other, and hence the density predicted by it is considerably higher than that of real physical systems. The LAMMPS simulation density is lower and closer to reality because it includes Lennard-Jones pair potentials between atoms within a certain proximity.&lt;br /&gt;
&lt;br /&gt;
The graph above also shows that the discrepancy slightly increases with pressure. This could be due to repulsive potentials being greater in the simulation, when the atoms are pushed closer together due to a higher pressure; this in turn causes further deviations from the Ideal Gas Law, which predicts a linear increase in density with an increase in pressure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the ideal gas law is a good approximation to dilute gases (at high temperature and low pressure).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities using Statistical Physics = &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: Heatcapacity.JPG|centre|frame|&#039;&#039;&#039;&amp;lt;math&amp;gt;\frac{C_v} {V}&amp;lt;/math&amp;gt; output in the Density-Temperature Phase Space&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;\frac {dU} {dT}&amp;lt;/math&amp;gt; decreases with increasing temperature because at higher temperatures, you are populating states that are closer in energy to each other; as you go higher in energy, the density of states increases and therefore &amp;lt;math&amp;gt;dU&amp;lt;/math&amp;gt; becomes smaller. So for the same &amp;lt;math&amp;gt;dT&amp;lt;/math&amp;gt; at higher temperatures, &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is smaller than that at lower temperatures.&lt;br /&gt;
&lt;br /&gt;
The heat capacity increasing with density can be purely explained by using statistical mechanics; it can be derived that the internal energy &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; at constant volume as in the system here = &amp;lt;math&amp;gt;\frac{3} {2} N k_B T&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dU} {dT}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{3} {2} N k_B&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the heat capacity increases with the number of atoms in the system, &#039;&#039;N&#039;&#039; and therefore with density &amp;lt;math&amp;gt;\frac{N} {V}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A more physical description would be that as the total energy is constant, in a simulation box with more atoms (larger N), the internal energy per atom is lower, and also there are greater energy losses due to more degrees of freedom, therefore to raise the temperature by a certain amount &amp;lt;math&amp;gt;dT&amp;lt;/math&amp;gt; requires a greater input of internal energy &amp;lt;math&amp;gt;dU&amp;lt;/math&amp;gt;, causing the heat capacity of the system &amp;lt;math&amp;gt;\frac{dU} {dT}&amp;lt;/math&amp;gt; to be higher for a system with higher N.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Right idea about relating the heat capacity to the density of states, more analysis would be needed to confirm this.  Energy should be constant over time, but the energy of two different systems with different numbers of particles is not the same.  The heat capacity increases with density because there are more particles which each require energy to increase the temperature of the system.  Give the equation for the line of best fit that you&#039;ve plotted on the graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script for the simulation with density 0.2 and temperature 2.0 is given below as an example. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
###DEFINE DENSITY###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 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;
reset_timestep 0&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 density atoms&lt;br /&gt;
variable temper equal temp&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable energytotal equal etotal&lt;br /&gt;
variable energytotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temper v_dens v_energytotal v_energytotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avedens equal f_aves[2]&lt;br /&gt;
variable heatcapacoverv equal ${n}*${dens}*(f_aves[4]-f_aves[3]*f_aves[3])/(f_aves[1]*f_aves[1])&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity over v: ${heatcapacoverv}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution Function =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: RDF.JPG|centre|frame|&#039;&#039;&#039;&amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;&#039;&#039;(left)&#039;&#039; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;(right)&#039;&#039; for a solid, liquid and gas&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions above provide us with the probability of finding an atom at a particular distance r from the reference atomic centre at r=0; the peaks visible in the radial distribution functions correspond to coordination shells (i.e. atomic centres). At a particular value of r, &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the total number of atoms within that radius. It is clear that the solid has the greatest long range order with the atoms packed closely together by strong interactions, due to it having the highest frequency and amplitude of peaks out of the three RDF plots as well as the highest integral at the end of the simulation. The particularly sharp nature of the peaks in the solid RDF is indicative of the solid&#039;s well packed structure; the regions of very low atomic density in between the peaks is because the atoms are packed so efficiently and regularly to fill the space, it is highly unlikely atoms will fit into these specific regions. The presence of some peaks in the liquid RDF at small values of r gives evidence of some short range order; the smoother nature and more curvature of the peaks for the liquid RDF compared to that for the solid RDF indicate that atomic density is less fixed at certain positions and therefore the atoms have more freedom to move around in a liquid. Meanwhile, just a single maximum in the gas RDF highlights how this phase is completely disordered with virtually no bonding interactions, supported by the fact that its integral increases extremely slowly over the course of the simulation, indicating that very few atoms are found over long range distances from the reference atom as well.&lt;br /&gt;
&lt;br /&gt;
[[File: Fcclattice.JPG|centre|frame|&#039;&#039;&#039;The lattice sites a, b and c correspond to the first three peaks on the solid RDF -&#039;&#039;a&#039;&#039; is the nearest neighbour to the reference atom and corresponds to the first peak, &#039;&#039;c&#039;&#039; is the third nearest neighbour to the reference atom and corresponds to the third peak &#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
As the face centred cubic lattice is two interpenetrating simple cubic lattices, the lattice spacing is defined by the distance between the reference atom and the second nearest neighbour, &#039;&#039;b&#039;&#039; -  this equals 1.525 and can be seen approximately by the position of the second peak on the solid RDF. If we consider 8 unit cells, 4 on top and 4 on bottom, then it can be understood that the coordination to &#039;&#039;a&#039;&#039; lattice sites is 12 as there are &amp;lt;math&amp;gt;\frac{3} {2} &amp;lt;/math&amp;gt; &#039;&#039;a&#039;&#039; coordination sites per unit cell and there are 8 unit cells. Similarly, the coordination to lattice site &#039;&#039;b&#039;&#039; is 6 as there are &amp;lt;math&amp;gt;\frac{3} {4} &amp;lt;/math&amp;gt; &#039;&#039;b&#039;&#039; coordination sites per unit cell and 8 unit cells, and the coordination to &#039;&#039;c&#039;&#039; is 24 as there are 3 coordination sites per unit cell and 8 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good diagram to show the positions of the nearest neighbour atoms.  How does the value of the lattice parameter compare with the value of the original fcc lattice in your simulations?  Could you have also calculated the lattice parameter from the first and third peak and then given an average value?  Coordination numbers are well worked out, but did you check these with the values from the running integral graph - zoom in to the first 3 peaks in this graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Dynamical properties and the diffusion coefficient =&lt;br /&gt;
&lt;br /&gt;
== Mean Squared Displacement ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Total MSD as a function of Timestep&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  [[File: SolidMSDsmall.JPG]]   ||[[File: LiquidMSDsmall.JPG]]   ||[[File: GasMSDsmall.JPG]]&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|[[File: SolidMSDlarge.JPG]]&lt;br /&gt;
|[[File: LiquidMSDlarge.JPG]]&lt;br /&gt;
|[[File: GasMSDlarge.JPG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MSD is higher for phases with greater disorder as expected, with the gas phase having the highest MSD at the end of the simulation, and the solid phase the lowest. Interestingly, the gas phase MSD initially climbs exponentially, but then shifts to a more linear behaviour towards the end of the simulation, suggesting that a limiting value of the diffusion coefficient has been reached in the simulation.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by: &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;
The liquid phase MSD holds a linear relationship throughout the simulation, therefore the limiting value for D is reached very quickly in this phase.&lt;br /&gt;
&lt;br /&gt;
The sharp initial increase and then drop to an average value for the solid phase MSD, can be explained by the atoms initially exchanging positions and rearranging, in order to find the most energetically favourable lattice arrangement; once this arrangement is reached, the atoms&#039; degrees of freedom are limited (mostly to vibrations) and the MSD drops slightly and reaches the value around which it fluctuates.&lt;br /&gt;
&lt;br /&gt;
The liquid phase MSD plots for the large and small system are very similar, but there are differences between large and small for the solid and gas phase; for the solid phase, there are no fluctuations about an average value in the large system - the MSD effectively reaches a constant here (possible outlier effects are reduced in this system due to a larger population being sampled), and the gas phase MSD plot is much more linear for the large system, meaning the limiting value of D is reached much sooner here than in the small system.&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficients follow suit, with the more disordered phase having the higher D value, as diffusion originates from random motion:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Estimated Diffusion Coefficients&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  &amp;lt;math&amp;gt;4.167\times10^{-6}&amp;lt;/math&amp;gt;   ||0.0833   ||4.658&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.167\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
|0.0833&lt;br /&gt;
|2.542&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The relationship between D and the MSD in the equation is linear, so you should only fit a straight line to the linear part of the graph, corresponding to the diffusive regime, not the entire data.  Why is this gas phase graph curved initially (ballistic motion)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Velocity Autocorrelation Function ==&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&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;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time is &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;
Therefore the velocity for a 1D harmonic oscillator is &amp;lt;math&amp;gt;v\left(t\right) =\frac{dx\left(t\right)} {dt} = -\omega A\sin\left(\omega t + \phi\right)&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} 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;= \frac{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)\left(-\omega A\sin\left(\omega\left(t+\tau\right)+\phi\right)\right)dt}{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)^2 dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)\left(-\omega A\sin\left(\omega t+\omega\tau+\phi\right)\right)dt}{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)^2 dt}&amp;lt;/math&amp;gt;&lt;br /&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) \left(sin\left(\omega t + \phi\right)\cos\left(\omega t\right) + cos\left(\omega t + \phi\right)\sin\left(\omega t\right)\right)dt}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\cos\left(\omega t\right)\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)} + \frac{\sin\left(\omega t\right)\int_{-\infty}^{\infty}\left(\sin\left(\omega t + \phi\right)\cos\left(\omega t + \phi\right)\right)}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\left(\sin\left(\omega t + \phi\right)\cos\left(\omega t + \phi\right)\right) dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, well noticed that the integrand is an odd function and so the integral is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: VACFharmsolliq.JPG|centre|frame|&#039;&#039;&#039;Comparing VACFs of the Harmonic Oscillator, solid phase, and liquid phase&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The VACF for the Harmonic Oscillator oscillates around 0 due to the cosine function. The Harmonic Oscillator assumes periodicity and ignores the possibility of collisions with particles over a long range, that can cause significant changes from the initial velocity. It can be seen that the liquid phase&#039;s VACF minimizes to 0 quite quickly and becomes constant (flattens out), within 100 timesteps, without any oscillation around 0, indicating that there is not much long range order in the liquid phase. On the other hand, the solid phase VACF continues to oscillate around 0 up to 350 timesteps, where it eventually also flattens out and hits a constant value of 0, indicating a much greater extent of long range order in this state. The Harmonic Oscillator is not an accurate representation of real physical systems, and the deviations from the model increase as the phases become more disordered and random collisions become more likely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Don&#039;t confuse the VACF with the RDF, the VACF doesn&#039;t tell you about long range order, but shows how quickly the system forgets the particle&#039;s velocities.  The VACF decorrelates due to collisions between particles which randomise particle velocities.  What do the minima in the solid and liquid VACFs represent physically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Comparing integrals under the VACF&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  [[File: Intsmallsol.JPG]]   ||[[File: Intsmallliq.JPG]]   ||[[File: Intsmallgas.JPG]]&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|[[File: Intlargesol.JPG]]&lt;br /&gt;
|[[File: Intlargeliq.JPG]]&lt;br /&gt;
|[[File: Intlargegas.JPG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Estimated Diffusion Coefficients using the VACF integral&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  &amp;lt;math&amp;gt;6.992\times10^{-4}&amp;lt;/math&amp;gt;   ||0.0991   ||8.24&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;math&amp;gt;1.25\times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
|0.0913&lt;br /&gt;
|3.270&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Like seen with the MSD estimate, the diffusion coefficients estimated here also agree with physical reality, with the coefficients increasing with more disordered phases. For the solid and liquid phases, as their VACF integral plots appear to flatten, it suggests that the diffusion coefficient limit has been reached for these phases within the simulation time. The largest source of error in the estimates of D from the VACF, is the usage of the Trapezium Rule as the method for integration, as at each dt, it could over and/or underestimate the true area under the function, particularly when the VACF has curvature. These errors are cumulative, and could lead to huge deviations from the true integral value at the end of the integration; by observing the curvature of the various VACFs plotted above, it can be seen how the VACF integral and thereby diffusion coefficient of the gas phase will be most affected by this error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The calculation of D from the VACF relies on the integral of the VACF reaching a plateau within the simulation time, is this the case here?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:LiquidSim:Sid220217&amp;diff=612337</id>
		<title>Talk:LiquidSim:Sid220217</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:LiquidSim:Sid220217&amp;diff=612337"/>
		<updated>2017-03-28T04:59:38Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  = Introduction to Molecular Dynamics Simulation = == Numerical Integration == &amp;#039;&amp;#039;&amp;#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Introduction to Molecular Dynamics Simulation =&lt;br /&gt;
== Numerical Integration ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Exact analytical solutions for the atomic position can only be found in simple systems such as the classic harmonic oscillator. For many-body systems with chaotic dynamics, numerical integration methods such as the velocity-Verlet algorithm are necessary, and only an approximation can be made for the atomic position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
On the chart below, both the classic harmonic oscillator solution and the velocity-Verlet algorithm are shown, with the classical result, &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; using the values of &amp;lt;math&amp;gt;A=1&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntAnalytical2.JPG|centre|frame| &#039;&#039;&#039;Displacement as a function of time, &amp;quot;ANALYTICAL&amp;quot; being the classical solution and &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; the velocity-Verlet algorithm&#039;&#039;&#039;]] &lt;br /&gt;
&lt;br /&gt;
The total energy for the velocity-Verlet solution is a sum of the potential and kinetic energy components, &amp;lt;math&amp;gt;E=U+K&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;U=\frac{1} {2}kx^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;V=\frac{1} {2}mv^2&amp;lt;/math&amp;gt;, and values of &amp;lt;math&amp;gt;k=m=1&amp;lt;/math&amp;gt; are used. (Remember that &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v\left(t\right)&amp;lt;/math&amp;gt; are obtained from the velocity-Verlet algorithm.)&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntEnergy2.JPG|centre|frame|&#039;&#039;&#039;Energy as a function of time&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The absolute difference between the classic harmonic oscillator solution and the velocity-Verlet Algorithm for the atomic position is given below, with an additional line plotted through the estimated error maxima.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NumericalIntErrorMaxima3.JPG|centre|frame| &#039;&#039;&#039;Absolute error between the classical solution and the velocity-Verlet Solution&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As the timestep is increased from 0.1, the amplitude and frequency of the total energy for the velocity-Verlet solution is increased (greater and more frequent fluctuations), as the  &amp;lt;math&amp;gt; x\left(t\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v\left(t\right)&amp;lt;/math&amp;gt; approximations obtained from the numerical-integration are now weaker as &amp;lt;math&amp;gt;\partial t&amp;lt;/math&amp;gt; is greater. The total energy does not fluctuate by more than 1% (0.005) when a timestep of 0.2 is used - the plot of the energy using this timestep is given below. When modelling a physical system numerically as done here, it is important to monitor the total energy throughout the simulation to check if it stays constant, as the simulation should obey the law of conservation of energy, that energy cannot be created or destroyed - only transformed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
[[File:NumericalIntTimestep.JPG|centre|frame|&#039;&#039;&#039;Energy as a function of time using the timestep 0.2, where the energy does not fluctuate by more than 1%&#039;&#039;&#039; ]]&lt;br /&gt;
&lt;br /&gt;
== Atomic Forces ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The force at this separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;:&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;The well depth&#039;&#039;&#039; (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;):&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r_0\right) = 0 = 4\epsilon \left( \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \sigma^6 - r_0^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0^6 = \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_0 = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_0}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remembering &amp;lt;math&amp;gt;\phi\left(r_0\right) = 4\epsilon \left( \frac{\sigma^{12}} {r_0^{12}} - \frac{\sigma^6} {r_0^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = -4\epsilon \left( -12\frac{\sigma^{12}} {r_0^{13}} + 6\frac{\sigma^6} {r_0^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = 48\epsilon\frac{\sigma^{12}} {r_0^{13}} - 24\frac{\sigma^6} {r_0^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{48\epsilon} {\sigma} - \frac{24\epsilon} {\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_0 = \frac{24\epsilon} {\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|A system is in equilibrium when the net force acting on it is 0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;48\epsilon\frac{\sigma^{12}} {r_{eq}^{13}} - 24\frac{\sigma^6} {r_{eq}^7} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;48\epsilon\frac{\sigma^{12}} {r_{eq}^{13}} = 24\frac{\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} = 2^{1/6}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}} {r_{eq}^{12}} - \frac{\sigma^6} {r_{eq}^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;r_{eq} = 2^{1/6}\sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}} {\left(2^{1/6}\sigma\right)^{12}} - \frac{\sigma^6} {\left(2^{1/6}\sigma\right)^6}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(\frac{1} {4} - \frac{1} {2}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left(-\frac{1} {4}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
!&#039;&#039;&#039;Evaluate&#039;&#039;&#039; &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;&#039;when&#039;&#039;&#039; &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{2\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(2\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(2\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(2\right)^{11}} + \frac{1} {5\left(2\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{2.5\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(2.5\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(2.5\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(2.5\right)^{11}} + \frac{1} {5\left(2.5\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty 4\epsilon\left(\frac{\sigma^{12}} {r^{12}} - \frac{\sigma^6} {r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon \left [-\frac {\sigma^{12}} {11r^{11}} + \frac{\sigma^6} {5r^5}\right ]^\infty_{3\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\epsilon\left(0\right) - 4\epsilon\left(-\frac{\sigma^{12}} {11\left(3\sigma\right)^{11}} + \frac{\sigma^{6}} {5\left(3\sigma\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 4\left(-\frac{1} {11\left(3\right)^{11}} + \frac{1} {5\left(3\right)^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= - 0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Estimation of the number of water molecules in 1 mL under standard conditions&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Estimation of the volume of 10000 water molecules under standard conditions&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;\rho_{H_2O} = 0.9982 g  mL^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of &amp;lt;math&amp;gt;{H_2O}&amp;lt;/math&amp;gt; in 1 mL =&amp;lt;math&amp;gt;\rho\times V = 1 gmL^{-1}\times 1 mL = 0.9982g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Molar mass of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;18.0153gmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of moles of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; in 1mL = &amp;lt;math&amp;gt;\frac{m} {M_r}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{0.9982g} {18.0153gmol^{-1}} = 0.05540845837mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules in 1mL = &amp;lt;math&amp;gt;n\times N_A&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.05540845837mol\times 6.022\times 10^{23}mol^{-1} = 3.3\times10^{22}molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
Number of &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules in moles = &amp;lt;math&amp;gt;\frac{N} {N_A}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{10000} {6.022\times 10^{23}mol^{-1}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.660577881\times 10^{-20}mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Mass of 10000 &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules = &amp;lt;math&amp;gt;n\times M_r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;1.660577881\times 10^{-20}mol\times 18.0153gmol^{-1}&amp;lt;/math&amp;gt; &lt;br /&gt;
= &amp;lt;math&amp;gt;2.99158087\times 10^{-19}g&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 &amp;lt;math&amp;gt;H_2O&amp;lt;/math&amp;gt; molecules = &amp;lt;math&amp;gt;\frac{m} {\rho}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{2.99158087\times 10^{-19}g} {0.9982gmL^{-1}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;3.00\times 10^{-19}mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The new position of the atom in a cubic simulation box that 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; is:&lt;br /&gt;
 &amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right)&amp;lt;/math&amp;gt; + &amp;lt;math&amp;gt;\left(0.7,0.6,0.2\right)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt; after the periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units?&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^*\times \sigma = 3.2\times 0.34\times 10^{-9} = 1.088\times 10^{-9}m = 1.088nm&amp;lt;/math&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\epsilon} {k_B}= 120 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = k_B\times 120\mathrm{K} = 1.381\times 10^{-23}JK^{-1}\times 120\mathrm{K} = 1.6572\times 10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;: &amp;lt;math&amp;gt;\epsilon = \frac{1.6572\times 10^{-21}J\times 6.022\times 10^{23}mol^{-1}} {1000}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.998\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;  &lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = \frac{1.5\times \epsilon} {k_B} = \frac{1.5\times 1.6572\times 10^{-21}J} {1.381\times 10^{-23}JK^{-1}} = 180\mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Equilibration =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are given random starting coordinates, it is possible the atoms could be in the repulsive regime of the Lennard-Jones Potential, as well as virtually on top of each other(superimposed), which is physically impossible. The small values of the separation r that could be randomly generated also give rise to unrealistic potential energies &amp;lt;math&amp;gt;\phi_r&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The problem with very large repulsive energies is that the simulation becomes unstable and can crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;Proof that a lattice spacing of 1.07722 in a simple cubic unit cell corresponds to a lattice point number density of 0.8&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;What is the side length of a face centred cubic unit cell when the lattice point number density is 1.2&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Volume occupied by 1 simple cubic unit cell = &amp;lt;math&amp;gt;1.0772^3&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.24993962&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is 1 lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
Therefore 1 lattice point occupies a volume of 1.24993962.&lt;br /&gt;
&lt;br /&gt;
Lattice point number density = (Unit Volume / Volume occupied by 1 lattice point)&amp;lt;math&amp;gt;\times&amp;lt;/math&amp;gt; No&#039; of lattice points in unit cell = &amp;lt;math&amp;gt;\frac{1} {1.249939632}\times 1&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt; &lt;br /&gt;
|&lt;br /&gt;
Lattice point number density = (Unit Volume / Volume occupied by 1 lattice point)&amp;lt;math&amp;gt;\times&amp;lt;/math&amp;gt; No&#039; of lattice points in unit cell&lt;br /&gt;
&lt;br /&gt;
There are 4 lattice points in a FCC unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = 4\times \frac{1} {V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V =\frac{4} {1.2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Side length of unit cell =&amp;lt;math&amp;gt;\left(\frac{4} {1.2}\right)^{1/3} = 1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If the initial lattice commands in the input file had &#039;&#039; lattice fcc&#039;&#039; written instead of &#039;&#039; lattice sc&#039;&#039; 4000 atoms would be created, as there are 4 lattice points per FCC unit cell, and the simulation has been instructed in the succeeding script to run as a box made from (10x10x10) unit cells.&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
region box block 0 10 0 10 0 10&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output log file from the simulation will contain the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Created 4000 atoms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&lt;br /&gt;
!&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| This command defines the mass for all atoms, of all types, that will be used in the simulation. In this particular instance, the command instructs that  all atoms of type 1 in this simulation, will have a mass of 1.0; the first number defining the atom type, and the second the mass in reduced units.&lt;br /&gt;
| This command tells LAMMPS how to compute the interaction energies in the simulation by defining the type of interactions between pairs of atoms, and the distance in which these types of interactions can exist in &#039;&#039;(the cut-off distance).&#039;&#039; All other possible pairwise interactions that are not mentioned in this command are ignored by LAMMPS, as well as &#039;long range&#039; interactions of the specified type (interactions that exceed the cut off distance), making the computation easier. In the command written here, it is instructed that in this simulation there will be a Lennard-Jones potential between pairs of atoms that are within a distance of 3.0 of each other.&lt;br /&gt;
| The pairwise force field coefficient is another predefined property required by LAMMPS to compute the energy in the simulation. The number and meaning of the coefficients depends on the pair style. The script &#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039; means that the pairwise forcefield coefficient between all types of atoms is 1.0. &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for a Lennard-Jones potential and why is a cutoff used?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As we are defining the initial position and velocity, we are using the velocity-Verlet algorithm for this integration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the second script, the script writer will have to calculate the required number of simulation runs by his or herself, and input this value every time the timestep is changed, in order to keep the total simulation time constant. The first script is the more useful script to use, because it allows the script writer to leave the mathematics to LAMMPS, which automatically adjusts the number of simulation runs when the timestep is changed through the variable &#039;&#039;n_steps&#039;&#039;, to keep the total simulation time constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, variables make it easy to change simulation parameters and limit the changes of makings mistakes.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy,pressure and temp vs time.PNG|centre|frame| &#039;&#039;&#039;Plots of Energy, Temperature and Pressure vs Time respectively using a Timestep of 0.001&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The plots above do show that equilibrium has been reached, as the energy minimizes and reaches a value around which it fluctuates and at the same time, temperature and pressure maximise and reach a value around which they fluctuate. The time at which this occurs, (approximately 0.4) is the point of equilibration. The synchronized timing of energy and temperature reaching a fluctuating value in particular is an indicator of equilibration, as it implies fulfillment of the Clausius inequality for the Helmholtz free energy, dA=0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:AllTimesteps.JPG|centre|frame|&#039;&#039;&#039;Energy vs Time for all Timesteps&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The timestep that minimizes the energy to the lowest value within the set simulation time (100) is the most accurate, as the lower the energy value in the simulation, the closer the simulation is to physical reality. Therefore, it can be seen from the plots above that simulation accuracy increases with timestep shortening. However, with shorter timesteps, computing the simulation takes longer, therefore a compromise is logical. In the graph above, as the plot for the 0.0025 timestep is almost superimposed on the 0.001 timestep plot (the shortest timestep and lowest energy output), it is feasible to say that 0.0025 is the largest timestep to give acceptable results. 0.015 is a particularly bad choice as the energy output from this timestep never actually reaches a fluctuating value within the set simulation time, and most importantly is continuously &#039;&#039;increasing&#039;&#039; not &#039;&#039;decreasing&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the length of the timestep and to make the simulations efficient you should choose the largest timestep that agrees with this.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Running Simulations under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Temperatures of 1.75, 2.0, 2.25, 2.5 and 2.75 and pressures of 2.6 and 2.8 were chosen. The pressures chosen were based around the average value for equilibration found in the previous section of this report (approximately 2.6). The timestep chosen for all these simulations was 0.0025, based also on the findings in the previous section of this report, of looking for a balance between accuracy of results and time taken for computation when choosing a timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&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;\sum_i m_i v_i^2 = 3 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;
&amp;lt;math&amp;gt;\left(\frac{\gamma^2}{2}\right)\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(\frac{\gamma^2}{2}\right)3 N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \plusmn\sqrt{\frac{\mathfrak{T}} {T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three numbers &#039;&#039;100 1000 100000&#039;&#039; represent the three arguments &#039;&#039;Nevery Nrepeat Nfreq&#039;&#039; which specify on what timesteps the input values of the simulation will be used to used to contribute to the final average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100&#039;&#039; i.e. &#039;&#039;Nevery&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number specifies the jump between timesteps used to compute the time average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;1000&#039;&#039; i.e. &#039;&#039;Nrepeat&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number specifies the number of timesteps used to compute the time average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;100000 &#039;&#039; i.e. &#039;&#039;Nfreq&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This number defines how often time averages will be taken.&lt;br /&gt;
&lt;br /&gt;
Therefore every 100 timesteps, values of properties such as temperature and pressure will be sampled, and a 1000 measurements will contribute to the average. As the average will be calculated after 100000 timesteps, and the timestep being used is 0.0025, the time the simulation will run for is 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
[[File: EqofState2.JPG|centre|frame|&#039;&#039;&#039;Simulation Density Output vs Ideal Gas Law Density Output&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density generated from the Ideal Gas Law, as the Ideal Gas Law ignores any interactions between atoms. Therefore as there are no repulsive forces according to the Ideal Gas Law, the atoms can get in very close proximity to each other, and hence the density predicted by it is considerably higher than that of real physical systems. The LAMMPS simulation density is lower and closer to reality because it includes Lennard-Jones pair potentials between atoms within a certain proximity.&lt;br /&gt;
&lt;br /&gt;
The graph above also shows that the discrepancy slightly increases with pressure. This could be due to repulsive potentials being greater in the simulation, when the atoms are pushed closer together due to a higher pressure; this in turn causes further deviations from the Ideal Gas Law, which predicts a linear increase in density with an increase in pressure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the ideal gas law is a good approximation to dilute gases (at high temperature and low pressure).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities using Statistical Physics = &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: Heatcapacity.JPG|centre|frame|&#039;&#039;&#039;&amp;lt;math&amp;gt;\frac{C_v} {V}&amp;lt;/math&amp;gt; output in the Density-Temperature Phase Space&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity &amp;lt;math&amp;gt;\frac {dU} {dT}&amp;lt;/math&amp;gt; decreases with increasing temperature because at higher temperatures, you are populating states that are closer in energy to each other; as you go higher in energy, the density of states increases and therefore &amp;lt;math&amp;gt;dU&amp;lt;/math&amp;gt; becomes smaller. So for the same &amp;lt;math&amp;gt;dT&amp;lt;/math&amp;gt; at higher temperatures, &amp;lt;math&amp;gt;C_v&amp;lt;/math&amp;gt; is smaller than that at lower temperatures.&lt;br /&gt;
&lt;br /&gt;
The heat capacity increasing with density can be purely explained by using statistical mechanics; it can be derived that the internal energy &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; at constant volume as in the system here = &amp;lt;math&amp;gt;\frac{3} {2} N k_B T&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{dU} {dT}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{3} {2} N k_B&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus the heat capacity increases with the number of atoms in the system, &#039;&#039;N&#039;&#039; and therefore with density &amp;lt;math&amp;gt;\frac{N} {V}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A more physical description would be that as the total energy is constant, in a simulation box with more atoms (larger N), the internal energy per atom is lower, and also there are greater energy losses due to more degrees of freedom, therefore to raise the temperature by a certain amount &amp;lt;math&amp;gt;dT&amp;lt;/math&amp;gt; requires a greater input of internal energy &amp;lt;math&amp;gt;dU&amp;lt;/math&amp;gt;, causing the heat capacity of the system &amp;lt;math&amp;gt;\frac{dU} {dT}&amp;lt;/math&amp;gt; to be higher for a system with higher N.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Right idea about relating the heat capacity to the density of states, more analysis would be needed to confirm this.  Energy should be constant over time, but the energy of two different systems with different numbers of particles is not the same.  The heat capacity increases with density because there are more particles which each require energy to increase the temperature of the system.  Give the equation for the line of best fit that you&#039;ve plotted on the graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script for the simulation with density 0.2 and temperature 2.0 is given below as an example. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
###DEFINE DENSITY###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 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;
reset_timestep 0&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 density atoms&lt;br /&gt;
variable temper equal temp&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable energytotal equal etotal&lt;br /&gt;
variable energytotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temper v_dens v_energytotal v_energytotal2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable avedens equal f_aves[2]&lt;br /&gt;
variable heatcapacoverv equal ${n}*${dens}*(f_aves[4]-f_aves[3]*f_aves[3])/(f_aves[1]*f_aves[1])&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity over v: ${heatcapacoverv}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution Function =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: RDF.JPG|centre|frame|&#039;&#039;&#039;&amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;&#039;&#039;(left)&#039;&#039; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; &#039;&#039;(right)&#039;&#039; for a solid, liquid and gas&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions above provide us with the probability of finding an atom at a particular distance r from the reference atomic centre at r=0; the peaks visible in the radial distribution functions correspond to coordination shells (i.e. atomic centres). At a particular value of r, &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; gives the total number of atoms within that radius. It is clear that the solid has the greatest long range order with the atoms packed closely together by strong interactions, due to it having the highest frequency and amplitude of peaks out of the three RDF plots as well as the highest integral at the end of the simulation. The particularly sharp nature of the peaks in the solid RDF is indicative of the solid&#039;s well packed structure; the regions of very low atomic density in between the peaks is because the atoms are packed so efficiently and regularly to fill the space, it is highly unlikely atoms will fit into these specific regions. The presence of some peaks in the liquid RDF at small values of r gives evidence of some short range order; the smoother nature and more curvature of the peaks for the liquid RDF compared to that for the solid RDF indicate that atomic density is less fixed at certain positions and therefore the atoms have more freedom to move around in a liquid. Meanwhile, just a single maximum in the gas RDF highlights how this phase is completely disordered with virtually no bonding interactions, supported by the fact that its integral increases extremely slowly over the course of the simulation, indicating that very few atoms are found over long range distances from the reference atom as well.&lt;br /&gt;
&lt;br /&gt;
[[File: Fcclattice.JPG|centre|frame|&#039;&#039;&#039;The lattice sites a, b and c correspond to the first three peaks on the solid RDF -&#039;&#039;a&#039;&#039; is the nearest neighbour to the reference atom and corresponds to the first peak, &#039;&#039;c&#039;&#039; is the third nearest neighbour to the reference atom and corresponds to the third peak &#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
As the face centred cubic lattice is two interpenetrating simple cubic lattices, the lattice spacing is defined by the distance between the reference atom and the second nearest neighbour, &#039;&#039;b&#039;&#039; -  this equals 1.525 and can be seen approximately by the position of the second peak on the solid RDF. If we consider 8 unit cells, 4 on top and 4 on bottom, then it can be understood that the coordination to &#039;&#039;a&#039;&#039; lattice sites is 12 as there are &amp;lt;math&amp;gt;\frac{3} {2} &amp;lt;/math&amp;gt; &#039;&#039;a&#039;&#039; coordination sites per unit cell and there are 8 unit cells. Similarly, the coordination to lattice site &#039;&#039;b&#039;&#039; is 6 as there are &amp;lt;math&amp;gt;\frac{3} {4} &amp;lt;/math&amp;gt; &#039;&#039;b&#039;&#039; coordination sites per unit cell and 8 unit cells, and the coordination to &#039;&#039;c&#039;&#039; is 24 as there are 3 coordination sites per unit cell and 8 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good diagram to show the positions of the nearest neighbour atoms.  How does the value of the lattice parameter compare with the value of the original fcc lattice in your simulations?  Could you have also calculated the lattice parameter from the first and third peak and then given an average value?  Coordination numbers are well worked out, but did you check these with the values from the running integral graph - zoom in to the first 3 peaks in this graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Dynamical properties and the diffusion coefficient =&lt;br /&gt;
&lt;br /&gt;
== Mean Squared Displacement ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Total MSD as a function of Timestep&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  [[File: SolidMSDsmall.JPG]]   ||[[File: LiquidMSDsmall.JPG]]   ||[[File: GasMSDsmall.JPG]]&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|[[File: SolidMSDlarge.JPG]]&lt;br /&gt;
|[[File: LiquidMSDlarge.JPG]]&lt;br /&gt;
|[[File: GasMSDlarge.JPG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The MSD is higher for phases with greater disorder as expected, with the gas phase having the highest MSD at the end of the simulation, and the solid phase the lowest. Interestingly, the gas phase MSD initially climbs exponentially, but then shifts to a more linear behaviour towards the end of the simulation, suggesting that a limiting value of the diffusion coefficient has been reached in the simulation.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by: &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;
The liquid phase MSD holds a linear relationship throughout the simulation, therefore the limiting value for D is reached very quickly in this phase.&lt;br /&gt;
&lt;br /&gt;
The sharp initial increase and then drop to an average value for the solid phase MSD, can be explained by the atoms initially exchanging positions and rearranging, in order to find the most energetically favourable lattice arrangement; once this arrangement is reached, the atoms&#039; degrees of freedom are limited (mostly to vibrations) and the MSD drops slightly and reaches the value around which it fluctuates.&lt;br /&gt;
&lt;br /&gt;
The liquid phase MSD plots for the large and small system are very similar, but there are differences between large and small for the solid and gas phase; for the solid phase, there are no fluctuations about an average value in the large system - the MSD effectively reaches a constant here (possible outlier effects are reduced in this system due to a larger population being sampled), and the gas phase MSD plot is much more linear for the large system, meaning the limiting value of D is reached much sooner here than in the small system.&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficients follow suit, with the more disordered phase having the higher D value, as diffusion originates from random motion:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Estimated Diffusion Coefficients&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  &amp;lt;math&amp;gt;4.167\times10^{-6}&amp;lt;/math&amp;gt;   ||0.0833   ||4.658&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;math&amp;gt;4.167\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
|0.0833&lt;br /&gt;
|2.542&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The relationship between D and the MSD in the equation is linear, so you should only fit a straight line to the linear part of the graph, corresponding to the diffusive regime, not the entire data.  Why is this gas phase graph curved initially (ballistic motion)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Velocity Autocorrelation Function ==&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&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;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time is &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;
Therefore the velocity for a 1D harmonic oscillator is &amp;lt;math&amp;gt;v\left(t\right) =\frac{dx\left(t\right)} {dt} = -\omega A\sin\left(\omega t + \phi\right)&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} 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;= \frac{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)\left(-\omega A\sin\left(\omega\left(t+\tau\right)+\phi\right)\right)dt}{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)^2 dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)\left(-\omega A\sin\left(\omega t+\omega\tau+\phi\right)\right)dt}{\int_{-\infty}^{\infty}\left(-\omega A\sin\left(\omega t + \phi\right)\right)^2 dt}&amp;lt;/math&amp;gt;&lt;br /&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) \left(sin\left(\omega t + \phi\right)\cos\left(\omega t\right) + cos\left(\omega t + \phi\right)\sin\left(\omega t\right)\right)dt}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\cos\left(\omega t\right)\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)} + \frac{\sin\left(\omega t\right)\int_{-\infty}^{\infty}\left(\sin\left(\omega t + \phi\right)\cos\left(\omega t + \phi\right)\right)}{\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty}\left(\sin\left(\omega t + \phi\right)\cos\left(\omega t + \phi\right)\right) dt = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega t\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, well noticed that the integrand is an odd function and so the integral is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: VACFharmsolliq.JPG|centre|frame|&#039;&#039;&#039;Comparing VACFs of the Harmonic Oscillator, solid phase, and liquid phase&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The VACF for the Harmonic Oscillator oscillates around 0 due to the cosine function. The Harmonic Oscillator assumes periodicity and ignores the possibility of collisions with particles over a long range, that can cause significant changes from the initial velocity. It can be seen that the liquid phase&#039;s VACF minimizes to 0 quite quickly and becomes constant (flattens out), within 100 timesteps, without any oscillation around 0, indicating that there is not much long range order in the liquid phase. On the other hand, the solid phase VACF continues to oscillate around 0 up to 350 timesteps, where it eventually also flattens out and hits a constant value of 0, indicating a much greater extent of long range order in this state. The Harmonic Oscillator is not an accurate representation of real physical systems, and the deviations from the model increase as the phases become more disordered and random collisions become more likely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Don&#039;t confuse the VACF with the RDF, the VACF doesn&#039;t tell you about long range order, but shows how quickly the system forgets the particle&#039;s velocities.  The VACF decorrelates due to collisions between particles which randomise particle velocities.  What do the minima in the solid and liquid VACFs represent physically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Comparing integrals under the VACF&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  [[File: Intsmallsol.JPG]]   ||[[File: Intsmallliq.JPG]]   ||[[File: Intsmallgas.JPG]]&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|[[File: Intlargesol.JPG]]&lt;br /&gt;
|[[File: Intlargeliq.JPG]]&lt;br /&gt;
|[[File: Intlargegas.JPG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|+ &#039;&#039;&#039;Estimated Diffusion Coefficients using the VACF integral&#039;&#039;&#039; &lt;br /&gt;
!&lt;br /&gt;
! &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Small System&#039;&#039;&#039;&lt;br /&gt;
|  &amp;lt;math&amp;gt;6.992\times10^{-4}&amp;lt;/math&amp;gt;   ||0.0991   ||8.24&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Large System (1 million atoms)&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;math&amp;gt;1.25\times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
|0.0913&lt;br /&gt;
|3.270&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Like seen with the MSD estimate, the diffusion coefficients estimated here also agree with physical reality, with the coefficients increasing with more disordered phases. For the solid and liquid phases, as their VACF integral plots appear to flatten, it suggests that the diffusion coefficient limit has been reached for these phases within the simulation time. The largest source of error in the estimates of D from the VACF, is the usage of the Trapezium Rule as the method for integration, as at each dt, it could over and/or underestimate the true area under the function, particularly when the VACF has curvature. These errors are cumulative, and could lead to huge deviations from the true integral value at the end of the integration; by observing the curvature of the various VACFs plotted above, it can be seen how the VACF integral and thereby diffusion coefficient of the gas phase will be most affected by this error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The calculation of D from the VACF relies on the integral of the VACF reaching a plateau within the simulation time, is this the case here?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Efr114ls&amp;diff=612329</id>
		<title>Talk:Efr114ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Efr114ls&amp;diff=612329"/>
		<updated>2017-03-27T03:14:11Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Tasks which were answered were answered well with good explanations, but the questions on the RDF and VACF were missing.  Make...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Tasks which were answered were answered well with good explanations, but the questions on the RDF and VACF were missing.  Make sure you attempt all of the tasks before spending too long on your answers to the earlier tasks as the later sections are more useful and more interesting.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
[[File:Initial graphsefr114.PNG|thumb|Figure 1a) A graph showing how position varies with time for both the Verlocity-Verlet model (blue points) of the harmonic oscillator and the analytical model of the harmonic oscillator (red points)&lt;br /&gt;
Figure 1b) A plot displaying how total energy of the system varies with time&lt;br /&gt;
&lt;br /&gt;
Figure 1c) A plot displaying how absolute error varies with time &lt;br /&gt;
]]&lt;br /&gt;
The file &#039;HO.xls&#039; contains a Velocity-Verlet model for the behaviour of a classical mechanic oscillator, this file was then expanded to include:&lt;br /&gt;
* Values for position at time &amp;lt;math&amp;gt; t &amp;lt;/math&amp;gt; using the classical mechanics model &lt;br /&gt;
* Values for absolute difference between the classical mechanics model and the Velocity-Verlet model&lt;br /&gt;
* Values for total energy of the system &lt;br /&gt;
This processed file can be accessed here: [[File:HOprocessedefr114.xls]]&lt;br /&gt;
&lt;br /&gt;
[[File:Bloopblood.PNG|centre|thumb|Figure 2: A plot showing the relationship between maxima of absolute error against time.]]&lt;br /&gt;
&lt;br /&gt;
The maximum deviation from the mean total energy, measured in percentage, was calculated for 20 timestep values ranging from 0.025 to 0.4. A graph and trend line were then plotted,seen in Fig.3 to produce a quadratic function and extrapolated for 1% deviation. The value of timestep used in further simulations must not exceed 0.282 - as above this value the total energy of the system fluctuations exceed the 1% limit.&lt;br /&gt;
&lt;br /&gt;
The total energy of a system is one way of monitoring if the method of simulation is valid. For a simulation to be valid it must obey the 1st law of thermodynamics. Total energy is also a useful property to track the process of equilibration and can be compared with experimental data and literature to determine the accury of the simulation method.&lt;br /&gt;
&lt;br /&gt;
[[File:Errorefr114section1.PNG|centre|thumb|Figure 3 A plot showing how maximum deviation from average varies with time ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate over time?  Good, thorough analysis of the choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The Lennard-Jones Model  ===&lt;br /&gt;
The Lennard-Jones model is widely used to describe how potential varies with distance between two non-ionic particles. It is not a completely accurate representation for a potential energy surface but its simplicity makes it an essential tool in computational chemistry.&lt;br /&gt;
&lt;br /&gt;
The potential between the two particles is zero when &amp;lt;math&amp;gt; r_0=\sigma &amp;lt;/math&amp;gt;, (calculations for this can be seen below). Sigma is the equivalent of half the internuclear distance between the non bonding particles-when the particles are the same type of atom, this value is known as the Van Der Waal&#039;s radius.  &lt;br /&gt;
&lt;br /&gt;
The equation for the Lennard-Jones Potential for an interaction between two non ionic bodies is : &lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r) = 4\epsilon\bigg(\frac {\sigma^{12}}{r^{12}} -  \frac {\sigma^{6}}{r^{6}}\bigg) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0 = 4\epsilon\bigg(\frac {\sigma^{12}}{r^{12}} -  \frac {\sigma^{6}}{r^{6}}\bigg) &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
The force due to this interaction is given by the negative of the derivative of potential in respect to to time, resulting in: &lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; F(r)= -\frac{d\phi(r) }{dr }= 24\epsilon\bigg(\bigg(\frac{\sigma^{6}}{r^{7}}\bigg) - 2\bigg(\frac{\sigma^{12}}{r^{13}}\bigg)\bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equilibruim separation, req, is achieved when the sum of the attractive forces F(r) is equal to zero. From this equation, the equilibrium separation can be determined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F(r)=0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^6}{r_{eq}^{7}}=2\frac{\sigma^12}{r_{eq}^{13}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^{6}=2\sigma^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]2&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the req value back into the Lennard-Jones potential equation, the depth of the potential and hence the energy required to fully dissociate the two atoms can be determined: phi=epsilon&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{\infty}^{2\sigma} \phi(r) \, dr = 4\epsilon\sigma\bigg(\frac{1}{5}\bigg(\frac{\sigma^{5}}{r^{5}}\bigg) - \frac{1}{11} \bigg( \frac{\sigma^{11}}{r^{11}}\bigg)\bigg) \bigg |_{\infty}^{2\sigma} = - 2.48*10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{\infty}^{2.5\sigma} \phi(r) \, dr = 4\epsilon\sigma\bigg(\frac{1}{5}\bigg(\frac{\sigma^{5}}{r^{5}}\bigg) - \frac{1}{11} \bigg( \frac{\sigma^{11}}{r^{11}}\bigg)\bigg) \bigg |_{\infty}^{2.5\sigma} = - 8.18*10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{\infty}^{3\sigma} \phi(r) \, dr = 4\epsilon\sigma\bigg(\frac{1}{5}\bigg(\frac{\sigma^{5}}{r^{5}}\bigg) - \frac{1}{11} \bigg( \frac{\sigma^{11}}{r^{11}}\bigg)\bigg) \bigg |_{\infty}^{3\sigma} = = - 3.29*10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the force is at r = sigma so you can simplify the expression a bit more.  Sigma can be thought of as the particle diameter, not the particle radius.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
Under standard conditions, the molar volume of water is &amp;lt;math&amp;gt; 18 mL mol^{-1}&amp;lt;/math&amp;gt;, multiplication of this value by &amp;lt;math&amp;gt;N_A&amp;lt;/math&amp;gt; produces an estimate for the number of water molecules in a millilitre&amp;lt;math&amp;gt; n = 3.34*10^{22} mL^{-1} &amp;lt;/math&amp;gt;. The division of this value by 10,000 gives an approximate value for the volume of 10,000 molecules of water &amp;lt;math&amp;gt; = 2.99*10^{-19} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The purpose of these calculations is to demostrate, one millimetre would corresponds to an extremely large system for calculations. Periodic Boundary conditions are essential for the simulations involved in this experiment, they allow unit cells to simulate a bulk liquid. The unit cells are projected in each direction of the axis and if an atom&#039;s trajectory leaves the unit cell, its trajectory will continue through the opposite edge of the trajectory. For example, an atom in a simple cubic unit cell that as the initial coordinates of &amp;lt;math&amp;gt; (0.5, 0.5, 0.5) &amp;lt;/math&amp;gt; and trajectory &amp;lt;math&amp;gt;(0.7, 0.6, 0.2) &amp;lt;/math&amp;gt; will have the final coordinates of &amp;lt;math&amp;gt; (0.7,0.6,0.2) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reduced units ===&lt;br /&gt;
Most software and literature involving Lennard-Jones potential uses reduced units. It reduces values to more managable orders of magnitude.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r*=\frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; E*=\frac{E}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; T*=\frac{K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Argon has the properties of &amp;lt;math&amp;gt; \sigma= 0.34 nm &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \frac{\epsilon}{k_B}=120 K &amp;lt;/math&amp;gt;, a Lennard-Jones cut-off value of &amp;lt;math&amp;gt; r*= 3.2 &amp;lt;/math&amp;gt; and in the system &amp;lt;math&amp;gt; T*=1.5 &amp;lt;/math&amp;gt;.&lt;br /&gt;
In real units, the Lennard jones cut-off value, &amp;lt;math&amp;gt; r= 1.1 nm &amp;lt;/math&amp;gt; and the well depth, &amp;lt;math&amp;gt; E_w= 1.0 kJ mol^{-1} &amp;lt;/math&amp;gt; with a temperature of &amp;lt;math&amp;gt; 180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
=== Creating the Simulation Box ===&lt;br /&gt;
&#039;&#039;&#039;Atom postion&#039;&#039;&#039; Within the input file for a simulation, the initial&lt;br /&gt;
positions for the atoms within the simulation box must be stated. A liquid, by definition, has no long range order so it would be a logical presumption to use randomly generated atomic coordinates, however this method can be problematic as it allows the creation of two atoms in close proximity. The issue involved with two atoms with separation of less than &amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt; is that, as seen in the Lennard-Jones plot, the potential between the atoms rapidly increases and tends to infinity. The creation of an intial state containing these high potentials and hence high energies would result in LAMMPS running to error and crashing when the simulation was run, unless an extremely small timestep is used- which limits the range of calculations possible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The set up and conditions of the simulation don’t necessarily have to correspond to  exact equilibrium conditions to occur, the conditions must be in a realistic range to equilibrium conditions, allowing the use of ordered particle coordinates. A primitive cubic lattice and other basic lattice structures may be used to control initial inter-atomic distances, preventing the issues that arise with randomization of coordinates.&lt;br /&gt;
&lt;br /&gt;
In following simulations, a primitive cubic lattice is uses to order the atoms, this lattice contains one lattice point per unit cell. Simple calculations for lattice constant, &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; (in reduced units) if lattice type and number density  are known.  &lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;Number Density=\frac{Number\ of\ lattice\ points}{Volume}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;0.8=\frac{1}{a^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{1.25} = 1.07722 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A face centred cubic lattice, however has 4 lattice points per unit cell as seen in Figure BLAH, but the same calculation can still be used to calculate lattive constant&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&amp;lt;math&amp;gt;Number Density=\frac{Number\ of\ lattice\ points}{Volume}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;1.2=\frac{4}{a^{3}}&amp;lt;/math&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]\frac{4}{1.2} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Number of atoms&#039;&#039;&#039; For a box with parameters defined as:&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
This creates a simulation box of the dimensions of 10 lattice spacing in each axis direction which corresponds to 10 unit cells in each direction and hence 1000 unit cells overall. If the lattice type used is primitive cubic with one lattice point per unit cell, 1000 lattice points and hence 1000 atoms would be created in the simulation box. If the lattice type used is face-centred cubic(FCC) with four lattice points per unit cell, 4000 lattice points and hence 4000 atoms would be created in the simulation box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other parameters&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt; mass [type of atom] [mass of atom] &amp;lt;/code&amp;gt; is used for setting the mass for each type of atom. The first value indicates the type of atom and the second value indicates the mass of that type of the atom. In the simulations run in this simulation only one type of atom is used and hence the code &amp;lt;code&amp;gt; mass 1 1.0 &amp;lt;/code&amp;gt; is used, however if there were more than one type of atom being used a code such as &amp;lt;code&amp;gt; mass 1 1.0 2 1.5 &amp;lt;/code&amp;gt; would be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, for more than one type of atom I think you would have to use two separate mass commands.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt; pair_style [type of interaction] [parameter]&amp;lt;/code&amp;gt; is used for setting the type of interactions between atoms. The first value defines the type of interaction between atoms such a Lennard-Jones &amp;lt;code&amp;gt;lj&amp;lt;/code&amp;gt;, Embedded Atom Model &amp;lt;code&amp;gt;eam&amp;lt;/code&amp;gt; and Stillinger-Weber&amp;lt;code&amp;gt;sw&amp;lt;/code&amp;gt;and &amp;lt;code&amp;gt;/cut&amp;lt;/code&amp;gt; shows that there is a cutoff &amp;lt;code&amp;gt;/coul&amp;lt;/code&amp;gt; or the lack of it shows that the presence or the absence of coloumbic interactions. The second value is the cutoff parameter in reduced distance units this value must be large than σ. The command used in the simulations in this experiment is &amp;lt;code&amp;gt; pair_style lj/cut 3.0 &amp;lt;/code&amp;gt; determines that the type of interactions are Lennard-Jones with a cutoff of 3.0 reduced distance units and with no columbic interactions or any other interactions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Here the cutoff is applied to the Lennard-Jones potential, not a Coloumbic potential, why is a cutoff used?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt; pair_coeff [type of atom][type of atom] [coefficient] [coefficient]&amp;lt;/code&amp;gt; is used to set the force field coefficients between the type of atoms. The first two values represent the atoms that are interaction and can be either numbers to represent to specify the types of atoms interaction or two asterisks to define all of the types of atoms are interacting. The last two values define the coefficients of these interactions representing &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; respectively. The code used in this experiment is &amp;lt;code&amp;gt; pair_coeff * * 1.0 1.0 &amp;lt;/code&amp;gt; determining that all types of atoms are interacting equally with each other with coefficients of 1.0 resulting in symmetrical interactions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Algorithm In the simulations in this experiment, both the initial position &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and intial velocity&amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are specified and hence the Velocity-Verlet intergration algorithm is used. The atoms are positioned in and ordered lattice - the primitive cubic lattice  and the intial velocities are randomized and generated using the Maxwell-Boltzmann distribution&lt;br /&gt;
&lt;br /&gt;
The plots in Figures 4,5 and 6 are plots of reduced energy, pressure and temperature against time for a 0.001 timestep and the system can be seen to equilibrate by time 0.25. After which, the values fluctuate around the mean with deviation of less that 1%.&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Energyefr114.PNG|thumb|none|350px|Figure 4: A plot displaying how the total energy of the system varies with time. dt=0.001]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:Tempefr114.PNG|thumb|none|350px|Figure 5: A plot displaying how the temperature of the system varies with time. dt=0.001]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt; [[File:Pressefr114.PNG|thumb|none|350px|Figure 6: A plot displaying how the pressure of the system varies with time. dt=0.01]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;Figure 7 shows the plot of variation of total energy against time for 5 different timesteps: 0.001, 0.0025, 0.0075, 0.01 and 0.015. The timestep of 0.015 is two large and causes the total energy to diverge away from equilibrium. The remaining timesteps all converge to equilibrium successfully, however a compromise must be made between accuracy of the equilibrium total energy and length of simulation. Total energy of the system should be independant to timestep and both 0.01 and 0.0075 timesteps result in a equilibrium total energy that is significantly higher than the lower timesteps, suggesting that these timesteps are less accurate. The most suitable timestep would be 0.0025 as it has similar accuracy to 0.001 but has a longer simulation.[[File:Energiesefr114.PNG|none|thumb|350px|Figure 7: A plot that displays the relationship between total energy and time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Changes in Input File&#039;&#039;&#039;   &lt;br /&gt;
&lt;br /&gt;
The average kinetic energy of the system, as stated by the equipartition theorem and due to the system having three degrees of freedom (x, y, z), can be given by: &lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E_{K} =\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\frac{3}{2}Nk_{B}T&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For an NpT system, the temperature must be maintained  at target temperature T. In MD, the kinetic energy and hence the temperature of the system fluctuates throughout the simulation, to prevent this fluctuation from occuring, a factor of GAMMA can be introduced to correct the fluctuation which multiplies the velocity of each of the atoms by a factor to maintain a constant temperature. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E_{K} =\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\frac{3}{2}Nk_{B}\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
These two equations can then be treated simulaniously to produce the desired scaling constant- allowing the isothermal system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} =\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt;\gamma =\sqrt\frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input file for NpT simulations contains a command in the format of &amp;lt;code&amp;gt; fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ... &amp;lt;/code&amp;gt;, this determines the calculations for the thermodynamic property averages.&lt;br /&gt;
The &amp;lt;code&amp;gt;Nevery&amp;lt;/code&amp;gt; specifies to use input values every N timesteps,.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Nrepeat&amp;lt;/code&amp;gt; specifies that an N number of times is used to input values to calculate averages.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Nfreq&amp;lt;/code&amp;gt; specifies to calculate averages every N timesteps.&lt;br /&gt;
&lt;br /&gt;
For this simulation, Nevery=100, Nrepeat=1000 and Nfreq=10000&lt;br /&gt;
&lt;br /&gt;
In summary,  1000 input values result in the simulation of &amp;lt;math&amp;gt;1*10^5&amp;lt;/math&amp;gt; time units in this simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Make sure that you understand these three values.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== The NpT Simulation ===&lt;br /&gt;
In simulations previous to this section, the ensemble being investigated was canonical (N, V, T kept constant) however in this simulation, the isothermal-isobaric ensemble is used (N, p, T kept constant). The timestep used for these simulations was 0.0025 as determined in the previous section. The pressures used were 2.5 and 3.0 in reduced units - decided due to the average temperature of  2.62 reduced unitswhen the system was in equilibrium in the previous simulations. The temperatures used were 1.60, 1.85, 2.10, 2.35 and 2.6 in reduced units - values must be greater than 1.5 as this is the critical temperature.&amp;lt;div&amp;gt;&lt;br /&gt;
The ideal gas plots for pressures 2.5 and 3.0, seen in Fig.8 were calculated using the formula &amp;lt;math&amp;gt; \rho*=\frac{p*}{T*} &amp;lt;/math&amp;gt;. For both pressures tested in these simulations, the ideal gas plot results in substantially higher values for the simulation for the Lennard-Jones liquid. These differences arise from the particle modeled, both ideal gases and Lennard-Jones liquids are based on broad and contrasting assumptions. An ideal gas is composed of identical particles of negligible volume and have no intermolecular forces between particles- resulting in the total energy of the system is completely from the kinetic energy of the particles and there are no potential energy contributions. In contrast to our simulations which have Lennard-Jones interactions between particles in the system resulting in a non-zero potential.  The discrepancy between the two models decreases and the temperature values increase, this could be due to the fact that at higher temperatures, average kinetic energy of the particles increases  and contributes more to the total energy of the system and hence Lennard-Jones fluid behaves more alike to an ideal gas with an increase of temperature. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&amp;lt;ul&amp;gt; &lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:Zoomyzoomefr114.png|thumb|none|450px|Figure 8: A figure displaying the relationship between density and temperature for an LJ fluid including error bars]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li style=&amp;quot;display: inline-block;&amp;quot;&amp;gt;[[File:Nptefr114.png|thumb|none|450px|Figure 9: A figure displaying the relationship between density and temperature for both the LJ fluids and ideal gases.]] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Specifically it is the lack of repulsive forces in the ideal gas that gives it a higher density than the Lennard-Jones simulations.  The ideal gas is a good approximation to a dilute gas (high temperature and low density) as in this situation interactions between particles are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations==&lt;br /&gt;
Heat capacity is the amount of energy required to heat a system by a unit temperature. It can be given using the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=N^{2}\frac{\langle E^{2}\rangle-\langle E\rangle^{2}}{k_BT^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity per Volume can be calculated using the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=N*\rho\frac{\langle E^{2}\rangle-\langle E\rangle^{2}}{k_BT^{2}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;math&amp;gt; N^{2} &amp;lt;/math&amp;gt; variable here is a correction factor that is required due to the LAMMPS software&#039;s method of calculating heat capacity, it also provides an easy conversion of heat capacity to heat capacity per volume due to the &amp;lt;math&amp;gt; \rho=\frac{N}{V} &amp;lt;/math&amp;gt; relationship.&lt;br /&gt;
&lt;br /&gt;
The ensemble used in these simulations is the canonical ensemble. In total ten simulations were run with densities of 0.8 or 0.2 in reduced units and temperatures of 2.0, 2.2, 2.4, 2.6 and 2.8 in reduced units. &amp;lt;code&amp;gt;variable heatcap&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt; variable heatcapperv&amp;lt;/code&amp;gt; were built into the code to calculate the heat capacity and heat capacity per volume directly. Pressure calculations were removed from the script to reduce simulation times.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; was plotted as a function of temperature to produce Fig.10. Increasing the temperature of a system usually increases the specific heat capacity of a system, however as seen in Fig. 10,in this simulation and increase of the temperature of a system results in a decrease of Heat capacity for both densities. In comparison to literature, the trend is most likely due to the Frenkel line being crossed resulting in an dynamic transition from a rigid liquid to a non-rigid gas-like fluid, in this state an increase in temperature  results in lower vibrational energy but higher diffusion rates which results in a reduction of internal energy. The physical definition of heat capacity &amp;lt;math&amp;gt; C_V=\frac{\delta U}{\delta T} &amp;lt;/math&amp;gt;, therefore a reduction in internal energy results in a reduction of specific heat capacity. &lt;br /&gt;
 file://icnas4.cc.ic.ac.uk/efr114/ncomms3331.pdf&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestion for the trend in heat capacity with temperature, more analysis beyond the scope of this experiment would be needed to confirm this trend, why do you think heat capacity usually increases with temperature?  What about the trend with density?  What function did you fit to your results and why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Spec heatcapefr114.PNG|none|thumb|450px|Figure 10: A graph to show how heat capacity varies with temperature.]]&lt;br /&gt;
Below is an intro file used for the heat capacity simulations.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable dens equal 0.8&lt;br /&gt;
&lt;br /&gt;
lattice sc ${dens}&lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY ENSEMBLE ###&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp&lt;br /&gt;
&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RECORD TRAJECTORY ###&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; MEASURE SYSTEM STATE ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp density&lt;br /&gt;
&lt;br /&gt;
variable etot equal etotal&lt;br /&gt;
&lt;br /&gt;
variable etot2 equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_etot v_etot2&lt;br /&gt;
&lt;br /&gt;
unfix nvt &lt;br /&gt;
&lt;br /&gt;
fix nve all nve  &lt;br /&gt;
&lt;br /&gt;
run 100000  &lt;br /&gt;
&lt;br /&gt;
variable averagetemp equal f_aves[1]&lt;br /&gt;
&lt;br /&gt;
variable heatcap equal (atoms*atoms*(f_aves[3]-f_aves[2]*f_aves[2])/(f_aves[1]*f_aves[1]))&lt;br /&gt;
&lt;br /&gt;
variable heatcapperv equal ((atoms*${dens})*(f_aves[3]-f_aves[2]*f_aves[2])/(f_aves[1]*f_aves[1]))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temp: ${averagetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Heat Capacity per unit volume: ${heatcapperv}&amp;quot;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Temperature (reduced units)&lt;br /&gt;
!Density (reduced units)&lt;br /&gt;
|-&lt;br /&gt;
|Vapour&lt;br /&gt;
|1.5&lt;br /&gt;
|0.01&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.25&lt;br /&gt;
|0.8&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the Diffusion coefficient==&lt;br /&gt;
The MSD measures the deviation of the particles postion in respect to a standard reference position over time. Simulations for 8,000 particles were run and compared to simulations of 1,000,000 atoms.&lt;br /&gt;
As seen below, for both 8,000 and 1,000,000 particles, the solid-state simulations have a clear trend, the MSD rapidly increases until equilibrium is reached, after which there is very minimal variation- this is because solids are not capable of undergoing brownian motion and particle motion is confined. Both the liquid-phase and the vapour-phase increase steadily with time as both fluids and vapours experience brownian motion. The system with 1,000,000 particles gives a more accurate equilibrium with less fluctuation and deviation from the main value, this is due to the large number of particles in the system, resulting in a more narrow gaussian distribution and a better defined value.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid&lt;br /&gt;
!Vapour&lt;br /&gt;
|-&lt;br /&gt;
|8,000 particles&lt;br /&gt;
|[[File:Smallsoledefr114.PNG|frameless]]&lt;br /&gt;
|[[File:Smallliqefr114.PNG|frameless]]&lt;br /&gt;
|[[File:Smallvapefr114.PNG|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
|1,000,000 particles&lt;br /&gt;
|[[File:Efr114largesolid.PNG|frameless]]&lt;br /&gt;
|[[File:Efr114largeliq.PNG|frameless]]&lt;br /&gt;
|[[File:Efr114argeMSD.PNG|frameless]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Diffusion Coefficient(D) &lt;br /&gt;
&lt;br /&gt;
The diffusive behaviour of the system&#039;s that were tested can be simplified into a diffusive coeffictiant, the formula for which is:&lt;br /&gt;
&amp;lt;math&amp;gt; D=\frac{1}{6} \frac{\delta \langle r^{2} (t)\rangle}{\delta t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be easily determined from the linear plots to produce the values seen below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; |Diffusion Coefficient &amp;lt;math&amp;gt;m^2 s^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|8,000 particle simulation&lt;br /&gt;
|1,000,000 particle simulation&lt;br /&gt;
|-&lt;br /&gt;
|Vapour&lt;br /&gt;
|1.74&lt;br /&gt;
|3.12&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|9.26*10-2&lt;br /&gt;
|7.9810-2&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-2.31*10-7&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-8.75*10-7&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
These values are in agreement with both the MSD against time plots and with theory.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;VACF&#039;s&#039;&#039;&#039;&lt;br /&gt;
The velocity autocorrelation function can also be used to calculate the diffusion coefficient:&lt;br /&gt;
&amp;lt;math&amp;gt; C(T)=\langle v(t)*V(t+T)\rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plots look good, include the line of best fit that you used to calculate D on your plots.  Why does the gas phase MSD begin as a curved line (ballistic regime)?  Did you calculate D from the VACF?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Tfy286&amp;diff=612328</id>
		<title>Talk:Mod:Tfy286</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Tfy286&amp;diff=612328"/>
		<updated>2017-03-27T02:22:14Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks attempted, but some of the written explanations lacked a detail.  Make sure you have a good understanding of the th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks attempted, but some of the written explanations lacked a detail.  Make sure you have a good understanding of the theoretical background to the tasks and use this to explain the trends that you see in your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
1. 1). Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&lt;br /&gt;
&lt;br /&gt;
2). For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&lt;br /&gt;
&lt;br /&gt;
[[file:A.e.e.PNG]]&lt;br /&gt;
&lt;br /&gt;
2. Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;The maximum energy is 0.5. If the total energy does not change by more than 1%, the minimum energy should be 0.5*(1-1%)=0.495. Therefor the timestep is required to change to 0.2 (or less than 0.2).  Here is the new diagram when timestep equals to 0.2.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[file:Energy.change.PNG|x400px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What is the equation for the straight line that you&#039;ve plotted through the maxima in the error?  Why does the error oscillate over time?  Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
&#039;&#039;&#039;1). when potential energy=0, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;=0. So,&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2). energy is zero, so net force is zero as well.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The force is the first derivative of the potential, so it is not necessarily zero when the energy is zero, look at a plot of the Lennard-Jones potential, when the potential is zero is the gradient also zero?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3). at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, potential energy is minimum, &amp;lt;math&amp;gt; \frac{d\phi}{dr}\ &amp;lt;/math&amp;gt; = 0, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\dfrac{48\epsilon\sigma^{12}}{\sigma^{13}} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\dfrac{24\epsilon\sigma^{6}}{\sigma^{7}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
So, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\sqrt{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: At r_eq, r is not sigma, the correct answer should be r = 2^(1/6)*sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4). &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;\dfrac{-4r^{-11}}{11}+\dfrac{4r^{-5}}{5}= -0.0248&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&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177*10^{-3}&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&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-3.29*10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1). density of water is &amp;lt;math&amp;gt;1g/cm^3 &amp;lt;/math&amp;gt;, no.(water)= &amp;lt;math&amp;gt;\frac{1}{18}* 6.023* {10^{23}}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346*10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2). &amp;lt;math&amp;gt;\dfrac{1}{3.346*10^{22}}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\dfrac{volume(H2O)}{10000}&amp;lt;/math&amp;gt;, so volume of 10000 water molecules is  &amp;lt;math&amp;gt;2.98*10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. 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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The new position &amp;lt;math&amp;gt;\left(0.5+0.7, 0.5+0.6, 0.5+0.2\right)=\left(1.2, 1.1,0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;However it follows the periodic boundary condition, so it should be &amp;lt;math&amp;gt;\left(0.2, 0.1,0.7\right)&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6.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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1) r= 0.34* 3.2 nm = 1.088nm&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2) &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon= 120 * 1.38 *10 ^{-23} * 10^{-3} * 6.023 *10 ^{23} kJ/mol = 0.9974 kJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3) T= 120* 1.5 K = 180K&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===task===&lt;br /&gt;
1. Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If two atoms are too close together, there will be a huge repulsion existing between them. In order to calculate the huge energy change, the timestep should be very small. Therefore the computation process will be much more difficult. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the simulation will crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;there are four lattice points per volume per unit cell in a face-centred cubic.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{\tfrac{4}{1.2}} = 1.4938&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4*(10*10*10) = 4000 atoms will be created. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Using the LAMMPS manual, find the purpose of the following commands in the input script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1 indicates the atom type, here is type 1.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.0 indicates the atom mass, here is 1.0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut means cutoff Lennard-Jones potential with no Coulomb, &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3.0 is the arguments used by a particular style &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;asterisks here are used in place of or in conjunction with the I,J arguments to set the coefficients for multiple pairs of atom types. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.0 and 1.0 here are the coefficients for the atom types&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for the Lennard-Jones potential?  Why is a cutoff used with this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;velocity-Verlet algorithm &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If the timestep is fixed at 0.001, once the timestep is required to change, all the timesteps will change into other values by hand.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;However, if the timestep is set as a variable, only the first line is required to change, and the rest of them will change automatically. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7.1) make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report).&lt;br /&gt;
&lt;br /&gt;
[[File:E.t.p]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Does the simulation reach equilibrium? How long does this take? &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Yes, the simulation reaches equilibrium when time= 0.43&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report).&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.timestep.PNG|x600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4)Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;0.01 is the largest to give acceptable result. And 0.015 is a particular bad choice because there is a big deviation from the others.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Make the x axis range equal to the length of the shortest simulation.  Should the average total energy depend on the choice of timestep?  0.0025 is the best choice as it gives the same results as shorter timesteps (0.001), but simulations can cover a larger length of time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
1. Choose 5 temperatures (above the critical temperature T^* = 1.5), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen \left(p, T\right) points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Pressure&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Temperature&lt;br /&gt;
|-&lt;br /&gt;
| 2.7 , 2.8&lt;br /&gt;
| 1.8 , 1.9 , 2.0 , 2.1 , 2.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 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:&#039;&#039;&#039;&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;. Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;So, &amp;lt;math&amp;gt;\sum_i m_i \left(\gamma v_i\right)^2 = 3 N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \frac{1}{\sum_i v_i} \sqrt{\dfrac{3 N k_B}{\sum_i m_i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Not quite, take gamma out of the sum and then substitute the sum for the equation involving the current temperature, T, to get &amp;lt;math&amp;gt;\gamma = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;100 stands for the number of input values every this many timesteps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1000 stands for the number of times to use input values for calculating averages&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;100000 stands for calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Therefore the value of temperature will sampled for 1000 times. And there are 1000 measurements contributing to the average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Add more detail to show that you understand what the manual is saying about these three values.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 1). When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
&lt;br /&gt;
[[File:Density temperature 1.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The higher the pressure the discrepancy increases. &lt;br /&gt;
&lt;br /&gt;
2). You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;according to the ideal gas law, &amp;lt;math&amp;gt; p V = N k_B T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; density = \frac{N}{V}= \frac{p}{k_B T} = \frac{p}{T}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt;(reduced unit)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; The simulated density is lower than the ideal density. Because there are interaction forces existing among particles. When the pressure is applied, the repulsion between particles becomes dominant, and the distance between particles will be larger, so the density will be lower than the ideal situation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show all results on the same axes so that the trend with pressure is clear and don&#039;t plot a straight line between data points, especially for the ideal gas as the ideal gas law doesn&#039;t follow this trend (density is proportional to 1/T).  How does the discrepancy change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
===Task===&lt;br /&gt;
1. input script&lt;br /&gt;
 &amp;lt;pre&amp;gt;### DEFINE PARAMETERS ###&lt;br /&gt;
variable D equal 0.2&lt;br /&gt;
variable T equal 2.8&lt;br /&gt;
variable timestep equal 0.0075&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${D} &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;
### 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 atomss equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable energyvariance equal (f_aves[8]-f_aves[7]*f_aves[7])&lt;br /&gt;
variable heatcap equal ${atomss}*${avedens}*${energyvariance}/(f_aves[5])&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcap per volume: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Plot C_V/V as a function of temperature&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacity change.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How does the heat capacity change with density?  Can you give any suggestions about why the heat capacity decreases with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task===&lt;br /&gt;
1. perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate g(r) and &amp;lt;math&amp;gt; \int g(r)\mathrm{d}r &amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report.&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf of three states.PNG]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf 2.PNG|1000px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;g(r) shows several peaks in the liquid state, which means the probability at these radial distances will be much higher than the others. Secondly, there are much more peaks observed in solid phases. The peak differences are caused by the different interaction forces. In liquid phases, the attractive force is dominant, and in the solid phase, the structure is regular and periodic, the interaction is stronger than in liquid phase,  and the repulsive force is dominant.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;For face centred cubic, regarding (0,0,0) as a center, the first three peaks correspond to (1/2,1/2,0), (1,0,0) and (1,1,0).&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The difference from 0 to the second peak is the lattice point, 1.475.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The solid has peaks at large r which indicates long range order, the liquid only has short range order.  A diagram of an fcc lattice to show the atoms responsible for the first 3 peaks would have been good, did you calculate the coordination numbers as well - you can get these from the integral if you zoom in to look at the r values of the first 3 peaks.  Could you have calculated the lattice parameter from the first and third peaks as well and taken an average, how does it compare with the initial value that you use in the LAMMPS script?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficienT==&lt;br /&gt;
===Task===&lt;br /&gt;
1. make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(SOLID)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(LIQUID)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | MSD(GAS)&lt;br /&gt;
|-&lt;br /&gt;
| [[File:MSD SOLIDTFY.PNG]]&lt;br /&gt;
| [[File:MSD LIQTFY.PNG]]&lt;br /&gt;
| [[File:MSD GAS.PNG]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Are these plots for your simulation data or the data that you are given.  Is the solid MSD what you&#039;d expect - it doesn&#039;t look like the atoms are confined to lattice sites, did you change the lattice type to fcc?  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt; MSD= \langle (x(t)-x_0)^2 \rangle = 2Dt &amp;lt;/math&amp;gt;, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D= \tfrac{MSD}{2t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For solid, D = 0.0273/(2*0.016991) = 0.803&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For liquid, D = 2.81/(2*1.67448) = 0.839&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For gas, D = 12.9/(2*7.74)= 0.8333&lt;br /&gt;
&lt;br /&gt;
the MSD data given&lt;br /&gt;
[[File:Msd example.PNG]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you explain these graphs, are the data for the three phases on top of each other, is this what you would expect?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \tfrac{1}{3} \int_{0}^{\infty} C\left(\tau\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
2. 1). In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
Be sure to show your working in your writeup.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a 1D harmonic oscillator&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;
Therefore &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t+\tau\right) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because &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;
For the upper integration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin\left(\omega (t+\tau) + \phi\right) sin\left(\omega t + \phi\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin\left(\omega t + \phi\right) (sin\left(\omega t + \phi\right) cos(\omega\tau)+ sin\left(\omega\tau)cos(\omega t + \phi\right)) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 cos(\omega\tau)\int_{-\infty}^{\infty} sin^2 \left(\omega t + \phi\right) dt + A^2 \omega^2 sin(\omega\tau)\int_{-\infty}^{\infty}sin\left(\omega t + \phi\right) cos\left(\omega t + \phi\right) dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the lower integration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} v^2\left(t\right)dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = A^2 \omega^2 \int_{-\infty}^{\infty} sin^2 \left(\omega t + \phi\right) dt &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\omega\tau) + sin(\omega\tau) \int_{-\infty}^{\infty}\dfrac{cos(\omega t + \phi)}{sin\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =cos(\omega\tau) + sin(\omega\tau)\dfrac{ln(|sin\left(\omega t + \phi\right)|)}{\omega}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from &amp;lt;math&amp;gt;-\infty &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; \infty &amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\omega\tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, but check your working again, you cannot simplify the integrals like you have done.  You can make the derivation easier and avoid doing any integration by recognising the integrands as even and odd functions and simplifying them accordingly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2). On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt; \omega = 1/2\pi &amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)= cos(\tfrac{1}{2} \pi \tau) + 2\dfrac{sin(\tfrac{1}{2} \pi\tau)}{\pi}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcav.PNG]]&lt;br /&gt;
&lt;br /&gt;
3). What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The minima represents the starting points of self-diffusion. &#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The origin of the differences is the interaction force difference. The interaction is larger , so the diffusion coefficient is smaller, which can be also observed by the area difference under the VACF(r) curve of two different phases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Look at the equation for the VACF, when is it negative and so when do the minima occur?  Collisions between particles randomise particle velocities and cause the VACF to decorrelate, there are not collisions in the harmonic oscillator so it doesn&#039;t decay.  You should have plotted the harmonic oscillator VACF with omega = 1/(2*pi).  Did you try to calculate the running integral of the VACF or the diffusion coefficient from this?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ia2514_LiqSim&amp;diff=612327</id>
		<title>Talk:Mod:ia2514 LiqSim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ia2514_LiqSim&amp;diff=612327"/>
		<updated>2017-03-27T01:31:26Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered well.  Try to make your written explanations more specific and focus on the details which are most relevant to explaining the trends that you see in your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; &#039;&#039;&#039;Third year simulation experiment&#039;&#039;&#039; &amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This experiment involved performing molecular dynamics simulations for Lennard-Jones systems at various densities, pressures and temperatures, in the microcanonical, canonical and the isobaric-isothermal ensemble in order to investigate the variation of density with temperature at different pressures, to compute the heat capacity and the diffusion coefficient and plot the radial distribution function. The obtained results were correlated with theory and were used to investigate the structure and properties of the systems. All the simulations were run using LAMMPS and the resulting data was further plotted and analysed using Python and Excel. The trends observed in the results were as expected and the values obtained for the diffusion coefficient were in accordance with literature values. A lack of accuracy in some of the results was attributed to the system not reaching equilibrium within the simulated time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
&lt;br /&gt;
In this section, the values obtained by employing the Velocity Verlet algorithm for the position of a harmonic oscillator were compared with the classical results and were further used for calculating the total energy of the system. The change in total energy was calculated from the Velocity Verlet solution in order to determine the largest timestep value for which it does not exceed 1%. Various calculations regarding the Lennard-Jones potential, periodic boundary conditions and reduced units were performed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The energy of the system was calculated as a sum of the potential energy, &amp;lt;math&amp;gt;\frac{1}{2}kx^2&amp;lt;/math&amp;gt;, and the kinetic energy, &amp;lt;math&amp;gt;\frac{1}{2}mv^2&amp;lt;/math&amp;gt;. The filled in file can be found [[:File:Ia2514_HO.xls|here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Ia2514_maxerror.png|thumb|right|400px|&amp;lt;b&amp;gt;Figure 1.&amp;lt;/b&amp;gt; Maximum error in the position of the harmonic oscillator as calculated using the Velocity Verlet algorithm and the classical result]]&lt;br /&gt;
&lt;br /&gt;
The values of the maxima in the graph of the error (the absolute difference between the analytical solution for the position of the harmonic oscillator with respect to the values obtained from the velocity-Verlet algorithm) as a function of time, along with their corresponding times are presented in &amp;lt;b&amp;gt;table 1&amp;lt;/b&amp;gt; and plotted in &amp;lt;b&amp;gt;figure 1&amp;lt;/b&amp;gt;. They occur at time intervals of approximately 3 and can be fitted to a linear function (&amp;lt;math&amp;gt;4.22\times10^{-4}\times t-7.78\times10^{-5}&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you think the error oscillates over time even though the height of the maximum error increases?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center; width: 600px;&amp;quot;&lt;br /&gt;
|+&amp;lt;b&amp;gt;Table 1.&amp;lt;/b&amp;gt; Error maxima: classical result versus the Velocity Verlet solution&lt;br /&gt;
!Time!!Error&lt;br /&gt;
|-&lt;br /&gt;
|2.00||7.58E-4&lt;br /&gt;
|-&lt;br /&gt;
|4.90||2.01E-3&lt;br /&gt;
|-&lt;br /&gt;
|8.00||3.30E-3&lt;br /&gt;
|-&lt;br /&gt;
|11.10||4.60E-3&lt;br /&gt;
|-&lt;br /&gt;
|14.20||5.91E-3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Monitoring the total energy of the system is important for ensuring that the system has reached equilibrium. The variation in the total energy increases with the value of the timestep and a timestep of 0.334 leads to a change in the total energy of 1.00%. Therefore, in order to ensure that the energy does not change by more than 1% the timestep should be set to less than 0.334.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Energy must be conserved, approximately, for the simulation to give physically relevant results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\bullet&amp;lt;/math&amp;gt; The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_0\right) = 0 \Rightarrow 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 \Leftrightarrow \frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6} \Rightarrow r_0^6 = \sigma^6 \Rightarrow r_0 = \sigma&amp;lt;/math&amp;gt; (since &amp;lt;math&amp;gt;r_0 &amp;gt; 0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma &amp;gt; 0&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\bullet&amp;lt;/math&amp;gt; The force at this separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(r)=-\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r} \Rightarrow F(r)=-\frac{\mathrm{d}\left[4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\right]}{\mathrm{d}r} \Leftrightarrow F(r)=\frac{24\epsilon}{\sigma}\left[2\left(\frac{\sigma}{r}\right)^{13}-\left(\frac{\sigma}{r}\right)^7\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\Rightarrow F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\bullet&amp;lt;/math&amp;gt; At equilibrium, &amp;lt;math&amp;gt;F(r_{eq})=0 \Rightarrow \frac{24\epsilon}{\sigma}\left[2\left(\frac{\sigma}{r_{eq}}\right)^{13}-\left(\frac{\sigma}{r_{eq}}\right)^7\right]=0 \Rightarrow &lt;br /&gt;
2\left(\frac{\sigma}{r_{eq}}\right)^{13}-\left(\frac{\sigma}{r_{eq}}\right)^7=0 \Rightarrow 2\sigma^6=r_{eq}^6 \Rightarrow r_{eq}=\sqrt[6]{2}\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\bullet&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2}\sigma \Rightarrow \phi\left(r_{eq}\right)=4\epsilon \left(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6}\right) \Rightarrow \phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\bullet\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) \mathrm {d}r \\&lt;br /&gt;
&amp;amp;= 4\epsilon\sigma^{12}\int_{2\sigma}^\infty r^{-12}\mathrm{d}r - 4\epsilon\sigma^6\int_{2\sigma}^\infty r^{-6}\mathrm {d}r \\&lt;br /&gt;
&amp;amp;= \left.-\frac{4\epsilon\sigma^{12}}{11}r^{-11}\right|_{2\sigma}^\infty + \left.\frac{4\epsilon\sigma^6}{5}r^{-5}\right|_{2\sigma}^\infty \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma^{12}}{11}\left(2\sigma\right)^{-11}-\frac{4\epsilon\sigma^6}{5}\left(2\sigma\right)^{-5} \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma}{11\times2^{11}}-\frac{4\epsilon\sigma}{5\times2^5} \\&lt;br /&gt;
&amp;amp;= \frac{\left(5-11\times2^6\right)\epsilon\sigma}{5\times11\times2^9}&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For σ = ϵ = 1.0, &amp;lt;math&amp;gt; \int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.02482 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\bullet\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= \int_{2.5\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) \mathrm {d}r \\&lt;br /&gt;
&amp;amp;= 4\epsilon\sigma^{12}\int_{2.5\sigma}^\infty r^{-12}\mathrm{d}r - 4\epsilon\sigma^6\int_{2.5\sigma}^\infty r^{-6}\mathrm {d}r \\&lt;br /&gt;
&amp;amp;= \left.-\frac{4\epsilon\sigma^{12}}{11}r^{-11}\right|_{2.5\sigma}^\infty + \left.\frac{4\epsilon\sigma^6}{5}r^{-5}\right|_{2.5\sigma}^\infty \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma^{12}}{11}\left(2.5\sigma\right)^{-11}-\frac{4\epsilon\sigma^6}{5}\left(2.5\sigma\right)^{-5} \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma}{11\times2.5^{11}}-\frac{4\epsilon\sigma}{5\times2.5^5} \\&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For σ = ϵ = 1.0, &amp;lt;math&amp;gt; \int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00817 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
\bullet\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r &amp;amp;= \int_{3\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) \mathrm {d}r \\&lt;br /&gt;
&amp;amp;= 4\epsilon\sigma^{12}\int_{3\sigma}^\infty r^{-12}\mathrm{d}r - 4\epsilon\sigma^6\int_{3\sigma}^\infty r^{-6}\mathrm {d}r \\&lt;br /&gt;
&amp;amp;= \left.-\frac{4\epsilon\sigma^{12}}{11}r^{-11}\right|_{3\sigma}^\infty + \left.\frac{4\epsilon\sigma^6}{5}r^{-5}\right|_{3\sigma}^\infty \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma^{12}}{11}\left(3\sigma\right)^{-11}-\frac{4\epsilon\sigma^6}{5}\left(3\sigma\right)^{-5} \\&lt;br /&gt;
&amp;amp;= \frac{4\epsilon\sigma}{11\times3^{11}}-\frac{4\epsilon\sigma}{5\times3^5} \\&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For σ = ϵ = 1.0, &amp;lt;math&amp;gt; \int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since the density of water under standard conditions is 1 g/mL, the mass of 1 mL of water is m = 1 g.&lt;br /&gt;
&lt;br /&gt;
The number of molecules in 1 mL of water is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
N &amp;amp;= \frac{m \times N_\mathrm{A}}{\mu} \\&lt;br /&gt;
&amp;amp;= \frac{1 \times 6.022 \times 10^{23}}{ 18.015 } \\&lt;br /&gt;
&amp;amp;= 3.34 \times 10^{22} \\&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mass of N=10000 water molecules is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
m &amp;amp;= \frac{N \times \mu}{N_\mathrm{A}} \\&lt;br /&gt;
&amp;amp;= \frac{10000 \times 18.015}{ 6.022 \times 10^{23} } \\&lt;br /&gt;
&amp;amp;= 2.99 \times 10^{-19} \mathrm{g} \\&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is therefore &amp;lt;math&amp;gt;V=1 \frac{\mathrm{g}}{\mathrm{mL}} \times 2.99 \times 10^{-19} \mathrm{g} = 2.99 \times 10^{-19} \mathrm{mL}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After moving along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;, the atom ends up at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)+\left(0.7, 0.6, 0.2\right)=\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;. By applying the periodic boundary conditions, this is equivalent to &amp;lt;math&amp;gt;\left(1.2\bmod 1 , 1.1 \bmod 1, 0.7 \bmod 1 \right)=\left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma} \Rightarrow r=r^* \times \sigma \Rightarrow r = 3.2 \times 0.34\mathrm{nm} = 1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = k_\mathrm{B} \times \frac{\epsilon}{k_\mathrm{B}} \Rightarrow \epsilon = 1.38 \times 10^{-23} \times 120 = 1.656 \times 10^{-21} \mathrm{J} \Rightarrow \epsilon = 1.656 \times 10 ^{-21} \times 10^{-3} \times N_\mathrm{A} = 1.00 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The temperature is &amp;lt;math&amp;gt;T=T^*\times \frac{\epsilon}{k_\mathrm{B}} \Rightarrow T=1.5\times 120=180 \mathrm{K}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
Simulations for the same system (in the microcanonical ensemble) at five different timesteps (0.001, 0.0025, 0.0075, 0.01, 0.015) were performed and various commands within the input files were explained. The energy, pressure and temperature were plotted against time for the five timestep values which allowed for the selection of an optimum timestep to be used in further simulations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 8===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Setting up a simulation with random coordinates could generate atoms that are too close together (at a distance lower than the sum of their Van der Waals radii), which would lead to strong repulsion. The probability of creating overlapping atoms is higher for more dense systems.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What would be the problem with strong repulsive forces?  Large forces can make the simulation unstable and cause it to crash unless much smaller timesteps are used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 9===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since the density &amp;lt;math&amp;gt;\frac{N}{V}=0.8&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N=1&amp;lt;/math&amp;gt; (because it is a simple cubic lattice), the volume of the unit lattice is &amp;lt;math&amp;gt;V=\frac{1}{0.8}=1.25&amp;lt;/math&amp;gt; and therefore &amp;lt;math&amp;gt;L^3=1.25 \Rightarrow L=1.07722&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the case of a FCC lattice (for which &amp;lt;math&amp;gt;N=4&amp;lt;/math&amp;gt;) with a lattice point number density of 1.2, the volume is &amp;lt;math&amp;gt;V=\frac{4}{1.2}=3.33&amp;lt;/math&amp;gt; which gives a side length of the cubic unit cell of &amp;lt;math&amp;gt;L=\sqrt[3]{3.33}=1.49380&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 10===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice the number of lattice points per unit cell is 4, and therefore for a 10x10x10 box, the &amp;lt;code&amp;gt;create_atoms&amp;lt;/code&amp;gt; command would create 4x10x10x10=4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 11===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;mass 1 1.0&amp;lt;/code&amp;gt; command sets the mass of all the atoms of type 1 to 1.0 (in this case, all the atoms are of type 1, as set in the command &amp;lt;code&amp;gt;create_atoms 1 box&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pair_style lj/cut 3.0&amp;lt;/code&amp;gt; command models the interactions between each pair of atoms using the standard Lennard-Jones potential, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; with a cutoff of 3.0 (i.e. the potential is calculated only for &amp;lt;math&amp;gt;r&amp;lt;3.0&amp;lt;/math&amp;gt;; above this value it is 0).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/code&amp;gt; command sets &amp;lt;math&amp;gt;\epsilon=1.0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma=1.0&amp;lt;/math&amp;gt; for all the possible pairs of atoms (the asterisk represents all the atom types).&lt;br /&gt;
&lt;br /&gt;
All the aforementioned values are in reduced units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Well explained, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 12===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since both the position &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and velocity &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are used as initial conditions, the Velocity Verlet Algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 13===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of using ${timestep} instead of 0.001 (i.e. using a variable instead of a numeric value) is to facilitate using the same script with different values and ensure consistency. By using variables, any change in values has to be done only once (when assigning the values to the variable) and any mistakes in replacing the numbers manually are avoided.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 14===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: 0px&amp;quot;&lt;br /&gt;
||[[File:ia2514_TotEn_vs_time_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 2.&amp;lt;/b&amp;gt; Total energy versus time for a timestep of 0.001 ]]&lt;br /&gt;
||[[File:ia2514_Temp_vs_time_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 3.&amp;lt;/b&amp;gt; Temperature versus time for a timestep of 0.001 ]]&lt;br /&gt;
||[[File:ia2514_Press_vs_time_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 4.&amp;lt;/b&amp;gt; Pressure versus time for a timestep of 0.001 ]]&lt;br /&gt;
|-&lt;br /&gt;
||[[File:ia2514_TotEn_vs_time_zoom_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 5.&amp;lt;/b&amp;gt; Total energy versus time for a timestep of 0.001 (time 0-2)]]&lt;br /&gt;
||[[File:ia2514_Temp_vs_time_zoom_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 6.&amp;lt;/b&amp;gt; Temperature versus time for a timestep of 0.001 (time 0-2)]]&lt;br /&gt;
||[[File:ia2514_Press_vs_time_zoom_0.001.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 7.&amp;lt;/b&amp;gt; Pressure versus time for a timestep of 0.001 (time 0-2)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_TotEng_vs_time_all.png|thumb|right|400px|&amp;lt;b&amp;gt;Figure 8.&amp;lt;/b&amp;gt; Total energy versus time for various timesteps]]&lt;br /&gt;
&lt;br /&gt;
As shown in &amp;lt;b&amp;gt;figures 2-4&amp;lt;/b&amp;gt;, the system reaches equilibrium since, after an equilibration time, the total energy, temperature and pressure all start fluctuating around a constant equilibrium value. &amp;lt;b&amp;gt;Figures 5-7&amp;lt;/b&amp;gt; illustrate the same graphs for the time interval [0,2], revealing that the system equilibrates after &amp;lt;math&amp;gt;t\approx 0.5&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 8&amp;lt;/b&amp;gt; shows a graph of the total energy as a function of time for five different timesteps: 0.001, 0.0025, 0.0075, 0.01 and 0.015. As expected, a smaller timestep minimises the total energy, since it approaches the behaviour of a real physical system, so the lowest total energy is obtained for a timestep of 0.001. A timestep of 0.0025 gives an average total energy at equilibrium that is within 0.0045% of the value obtained in the case of a timestep of 0.001, deeming it a suitable choice for further simulations as it allows for a shorter computational time (less timesteps) than a timestep of 0.001 (for the same simulation time) while yielding reasonably accurate results.&lt;br /&gt;
&lt;br /&gt;
Another notable feature of the plot in &amp;lt;b&amp;gt;figure 8&amp;lt;/b&amp;gt; is the fact that an increase in the size of the timestep eventually leads to non-equilibration: in the case of a timestep of 0.015, the system does not reach equilibrium within the time &amp;lt;math&amp;gt;\Delta t=100&amp;lt;/math&amp;gt;, its average total energy increasing steadily after the initial decrease. A timestep of 0.015 is therefore not a good choice for simulating such a system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the average total energy should not depend on the timestep, so 0.0025 is the best choice.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
In this section, performing simulations at seven temperatures and three pressures in the NpT ensemble allowed for the investigation of the variation of density with temperature and a comparison with results obtained from the ideal gas equation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 15===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simulations were run for seven different temperatures: 1.6, 1.7, 1.8, 1.9, 2.0, 2.2 and 2.4 at three different pressures: 2.5, 3.0 and 3.5 and with a timestep of 0.0025, which was previously selected to be a suitable value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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:&#039;&#039;&#039;&lt;br /&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;
&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a constant, it can be taken out of the sum: &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} \Rightarrow \gamma^2 \frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Replacing the sum from the first equation gives &amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T=\frac{3}{2} N k_B \mathfrak{T} \Rightarrow \gamma=\pm\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Given that &amp;lt;math&amp;gt;\gamma &amp;gt;0&amp;lt;/math&amp;gt;, it follows that &amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The three number arguments of &amp;lt;code&amp;gt;fix ave/time&amp;lt;/code&amp;gt; represent (in order) the number of steps elapsed between sampling values for the average, the number of values that contribute to the average and the number of steps after which the average is computed. The values of temperature, etc. are therefore sampled every 100 steps for the average and 1000 out of these measurements contribute to the average, which is calculated every 100000 steps.&lt;br /&gt;
&lt;br /&gt;
The simulation will run for 100000 steps (&amp;lt;code&amp;gt;run 100000&amp;lt;/code&amp;gt;) and hence, for a timestep of 0.0025, the time that will be simulated is &amp;lt;math&amp;gt;100000\times 0.0025 = 250&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_Dens_vs_temp.png|thumb|right|200px|&amp;lt;b&amp;gt;Figure 9.&amp;lt;/b&amp;gt; Density as a function of temperature at three different pressures (both simulation results and ideal gas)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 18===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 9&amp;lt;/b&amp;gt; shows the expected trend in the values of the density as a function of temperature: for all three pressures simulated, the density decreases with an increase in temperature. The plot also displays the density as obtained from the ideal gas equation (&amp;lt;math&amp;gt;\frac{N^*}{V^*}=\frac{p^*}{T^*}&amp;lt;/math&amp;gt;) and as expected, the values obtained from the Lennard-Jones systems are lower than those calculated for an ideal gas, for all three pressures. This discrepancy can be explained through the approximations made when considering an ideal gas: the interactions between the particles are purely elastic, whereas the Lennard-Jones potential takes into account the attractive forces between the particles (as well as the repulsive ones). The difference between the ideal gas and the Lennard-Jones densities also increase with an increase in pressure and decrease in temperature (which is consistent with the fact that the ideal gas theory works best for very dilute gases, reduced pressures and high temperatures): for a pressure of 2.5 the difference decreases with temperature from 0.84 to 0.46, whereas for a pressure of 3.5, this difference ranges from 1.41 to 0.81.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The main approximation in the ideal gas equation that is relevant here is the lack of repulsive forces which means that particles in an ideal gas can be at much higher densities than in a Lennard-Jones gas, attractive forces are not very significant in a gas.  Try to be a bit more specific in your answer.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The change in heat capacity per volume with temperature was studied using the results obtained from running simulations for a Lennard-Jones system at five different temperatures and two density values. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_HeatCap_vs_temp3.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 10.&amp;lt;/b&amp;gt; Heat capacity per volume versus temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
The trend shown in &amp;lt;b&amp;gt;figure 10&amp;lt;/b&amp;gt; is the one expected: the heat capacity decreases with temperature for both densities. This observation can be explained through the fact that at higher temperatures, the particles vibrate more, the interactions between them become weaker and therefore they can store less energy, leading to a decrease in their heat capacity. Between the two data sets, it can be observed that heat capacity increases with increasing density, since a higher density implies a larger number of particles per unit volume which can therefore store more energy, which is consistent with the fact that heat capacity is an extensive property.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of the trend with density.  For the trend with temperature, if particles vibrate more won&#039;t they store more kinetic energy?  The change in heat capacity with temperature can be related to the density of states, but more analysis is needed to recover this.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
variable dens equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${dens}&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;
### 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;
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;
### SWITCH OFF THERMOSTAT ###&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 vol density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable en equal etotal&lt;br /&gt;
variable en2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_vol v_en v_en2 v_temp2&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 avevol equal f_aves[3]&lt;br /&gt;
variable aveen equal f_aves[4]&lt;br /&gt;
variable aveen2 equal f_aves[5]&lt;br /&gt;
variable varen equal f_aves[5]-f_aves[4]*f_aves[4]&lt;br /&gt;
variable heatcap equal ${N2}*${varen}/f_aves[6]&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;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${avevol}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy: ${aveen}&amp;quot;&lt;br /&gt;
print &amp;quot;N2: ${N2}&amp;quot;&lt;br /&gt;
print &amp;quot;Var Energy: ${varen}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
Density and temperature values for the vapour, liquid and solid phases of a Lennard-Jones system were extracted from the phase diagram and used to compute the radial distribution function for the three states. Plots of the RDFs allowed for correlations with the structure of the system in each phase.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 20===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto;&amp;quot;&lt;br /&gt;
|+&amp;lt;b&amp;gt;Table 2.&amp;lt;/b&amp;gt; Parameters used for the Lennard-Jones system&lt;br /&gt;
!Phase!!Density!!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|vapour||0.07||1.3&lt;br /&gt;
|-&lt;br /&gt;
|liquid||0.80||1.2&lt;br /&gt;
|-&lt;br /&gt;
|solid||1.20||0.8&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The densities and temperatures for the solid and vapour systems were extracted from the Lennard-Jones system phase diagram &amp;lt;ref name=&#039;PhaseDiagram&#039;/&amp;gt; and are presented in &amp;lt;b&amp;gt;table 2&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: 0px&amp;quot;&lt;br /&gt;
|[[File:ia2514_RDF.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 11.&amp;lt;/b&amp;gt; RDF versus distance for a Lennard-Jones system in vapour, liquid and solid state]]&lt;br /&gt;
|[[File:ia2514_RDFint.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 12.&amp;lt;/b&amp;gt; RDF integral versus distance for a Lennard-Jones system in vapour, liquid and solid state]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_Fcc2.jpg|thumb|right|250px|&amp;lt;b&amp;gt;Figure 13.&amp;lt;/b&amp;gt; FCC lattice showing the corresponding positions of the first three peaks in the RDF graph]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions for vapour, liquid and solid Lennard-Jones systems are shown in &amp;lt;b&amp;gt;figure 11&amp;lt;/b&amp;gt; and present the expected features. At distances lower than the minimum interatomic distance, the RDF is zero for all three cases. The solid system, the most ordered one, presents sharp peaks corresponding to certain positions in the FCC lattice. The intensity of the peaks decreases with an increase in the radius suggesting a decrease in the long-range order, which can be attributed to thermal motion. The liquid system is not as ordered as the solid one (it only displays short-range order), but still presents a few peaks at low distances after which the RDF falls to 1, indicating a similar density in the spherical shell at distance r as in the bulk, and therefore a lack of long-range ordering of the system. The RDF for the vapour case is the one which falls to 1 at the lowest distance out of the three cases, an observation which is consistent with the lack of ordering observed in the gas phase.&amp;lt;ref name=&#039;Atkins&#039;/&amp;gt; Given the differences between the RDF plots for the three systems, it is expected that the running integral for the vapour reaches a plateau before the liquid, which in turn reaches a constant value before the solid. These features are confirmed by the graph in &amp;lt;b&amp;gt;figure 12&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the case of a solid system, the first RDF peaks represent the nearest neighbour shells. For a FCC lattice, we expect the first three peaks in the RDF to occur at r values corresponding to the distances between the yellow particle (the centre) and the blue, red and green particles in &amp;lt;b&amp;gt;figure 13&amp;lt;/b&amp;gt; as these are the first three closest particles to the centre. The values of the r distances for the first three RDF peaks, which approximately correspond to the predicted values, along with the corresponding distance to the centre as a function of the lattice spacing &amp;lt;math&amp;gt;L=1.4938&amp;lt;/math&amp;gt; (extracted from the log file of the simulation for the solid system) and the coordination numbers (calculated by considering the number of atoms per unit cell and the number of neighbouring cells) are presented in &amp;lt;b&amp;gt;table 3&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto;&amp;quot;&lt;br /&gt;
|+&amp;lt;b&amp;gt;Table 3.&amp;lt;/b&amp;gt; Lattice sites to which the first three peaks correspond to&lt;br /&gt;
!r value!!Distance from centre as a function of L!!Coordination number&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;1.025&amp;lt;/span&amp;gt;||&amp;lt;math&amp;gt;L\frac{\sqrt{2}}{2}&amp;lt;/math&amp;gt;||12&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1.475&amp;lt;/span&amp;gt;||&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;||6&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;1.825&amp;lt;/span&amp;gt;||&amp;lt;math&amp;gt;L\sqrt{\frac{3}{2}}&amp;lt;/math&amp;gt;||24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The running integral should not reach a plateau, but should reach a straight line with constant gradient as the RDF tends to 1, not zero.  The peaks in the solid RDF decrease over time because the volume of the spherical shell used in the calculation of the RDF increases more quickly than the number of atoms at a given distance.  Good diagram of an fcc lattice and good idea to use each of the first 3 peaks to compare with the lattice parameters, but you should show how well they agree - what is the lattice parameter predicted from each of the first 3 peaks?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
The mean square displacement and the velocity autocorrelation function were extracted from the outputs of simulations for the vapour, liquid and solid Lennard-Jones systems. The features of the plots of both MSD and VACF against time were discussed in correlation to the structures of the system in the three phases. The VACF of the Lennard-Jones system was also compared to the calculated VACF of a 1D harmonic oscillator. The diffusion coefficient was computed using both the MSD and VACF and the results were similar and consistent with literature values. The lack of accuracy in some of the results obtained by using the VACF were attributed to the systems not reaching equilibrium by the end of the simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 21===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters used for the vapour, liquid and solid are presented in &amp;lt;b&amp;gt;table 2&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 22===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: 0px&amp;quot;&lt;br /&gt;
|[[File:ia2514_MSD2.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 14.&amp;lt;/b&amp;gt; MSD versus time for a Lennard-Jones system in vapour, liquid and solid state]]&lt;br /&gt;
|[[File:ia2514_MSDmil2.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 15.&amp;lt;/b&amp;gt; MSD versus time for a Lennard-Jones system in vapour, liquid and solid state (one million atoms)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plots in &amp;lt;b&amp;gt;figures 14-15&amp;lt;/b&amp;gt; present the expected features: the mean square displacement increases in the order solid &amp;lt; liquid &amp;lt;&amp;lt; vapour, in accordance with the freedom of movement for the particles in each of the three states. After a period of time, they all exhibit a linear behaviour, with the vapour MSD gradient being the highest of the three and the solid MSD having an approximately constant value close to 0. The non-linear region at small t values represents the ballistic regime where, in the time before a particle collides with another particle, its velocity can be considered constant and therefore its MSD varies with t&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, leading to a parabolic curve at low t.&amp;lt;ref name=&#039;Ballistic&#039;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data points in the time interval [6,10] were each fitted to a linear function and the resulting gradients were used to calculate the diffusion coefficient according to the equation &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;. The results are summarised in &amp;lt;b&amp;gt;table 4&amp;lt;/b&amp;gt; and their magnitudes reflect the ease of diffusion within each phase: the diffusion coefficient for the vapour phase is higher than for the liquid and the one for the solid state is close to 0. The values obtained from the two data sets are similar, with the largest difference being observed in the case of the vapour phase (the smaller system yielded a diffusion coefficient value that is 20% smaller than the one calculated from the million atom simulation). Nevertheless, the values obtained for the diffusion coefficient are in accordance with previously reported values obtained through a similar method.&amp;lt;ref name=&amp;quot;MSD&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto;&amp;quot;&lt;br /&gt;
|+&amp;lt;b&amp;gt;Table 4.&amp;lt;/b&amp;gt; Diffusion coefficient calculated using the MSD&lt;br /&gt;
! rowspan=2|Data set!!colspan=3| Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
!Vapour!! Liquid !!Solid&lt;br /&gt;
|-&lt;br /&gt;
|8000/32000 atoms||2.51||8.48x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||-6.66x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1000000 atoms||3.14||8.90x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||1.22x10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|literature &amp;lt;ref name=&amp;quot;MSD&amp;quot;/&amp;gt;||3.694 (at density 0.05); 1.798 (at density 0.10)||7.9x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Very good explanation of the ballistic regime.  Show the different phases on different plots as it is difficult to see the shape of the solid or liquid MSD from those plots.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 23===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&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; and &amp;lt;math&amp;gt;v\left(t\right)=\frac{\mathrm{d}x\left(t\right)}{\mathrm{d}t} \Rightarrow v\left(t\right)=-A\omega sin\left(\omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
C\left(\tau\right) &amp;amp;= \frac{\int_{-\infty}^{\infty} \left[-A\omega sin\left(\omega t + \phi \right)\right]\left[-A\omega sin\left(\omega t + \omega \tau +\phi \right)\right]\mathrm{d}t}{\int_{-\infty}^{\infty} \left[-A\omega sin\left(\omega t + \phi \right)\right]^2\mathrm{d}t} \\&lt;br /&gt;
&amp;amp;=  \frac{\frac{A^2\omega^2}{2}\int_{-\infty}^{\infty}\left[cos\left(\omega\tau\right)-cos\left(2\omega t +\omega\tau+2\phi\right)\right]\mathrm{d}t}{\frac{A^2\omega^2}{2}\int_{-\infty}^{\infty}\left[1-cos\left(2\omega t +2\phi\right)\right]\mathrm{d}t}\quad\mathrm{ (using }\quad sin\left(a\right)sin\left(b\right)=\frac{1}{2}\left[cos\left(a-b\right)-cos\left(a+b\right)\right]\mathrm{)}\\&lt;br /&gt;
&amp;amp;=  \frac{\int_{-\infty}^{\infty}\left[cos\left(\omega t\right)-cos\left(\omega \tau\right)cos\left(2\omega t+2\phi\right)+sin\left(\omega \tau\right)sin \left(2\omega t+2\phi\right)\right]\mathrm{d}t}{\int_{-\infty}^{\infty}\left[1-cos\left(2\omega t +2\phi\right)\right]\mathrm{d}t}\quad\mathrm{ (using }\quad cos\left(a+b\right)=cos\left(a\right)cos\left(b\right)-sin\left(a\right)sin\left(b\right)\mathrm{)}\\&lt;br /&gt;
&amp;amp;=  \frac{cos\left(\omega\tau\right)\int_{-\infty}^{\infty}\left[1-cos\left(2\omega t +2\phi\right)\right]\mathrm{d}t+sin\left(\omega\tau\right)\int_{-\infty}^{\infty}sin\left(2\omega t+2\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty}\left[1-cos\left(2\omega t +2\phi\right)\right]\mathrm{d}t}\\&lt;br /&gt;
&amp;amp;=  cos\left(\omega\tau\right)+sin\left(\omega\tau\right)\frac{\int_{-\infty}^{\infty}sin\left(2\omega t+2\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty}\left[1-cos\left(2\omega t +2\phi\right)\right]\mathrm{d}t}\\&lt;br /&gt;
&amp;amp;= cos\left(\omega\tau\right)+sin\left(\omega\tau\right)\frac{\frac{-1}{2\omega}\left[cos\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}}{\left[t\right]_{-\infty}^{\infty}-\frac{1}{2\omega}\left[sin\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}}&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left[cos\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\left[sin\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}&amp;lt;/math&amp;gt; are finite numbers, &amp;lt;math&amp;gt;\left[t\right]_{-\infty}^{\infty} \rightarrow \infty &amp;lt;/math&amp;gt; and therefore, &amp;lt;math&amp;gt;\frac{\frac{-1}{2\omega}\left[cos\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}}{\left[t\right]_{-\infty}^{\infty}-\frac{1}{2\omega}\left[sin\left(2\omega t+2\phi\right)\right]_{-\infty}^{\infty}}\rightarrow 0&amp;lt;/math&amp;gt; which leads to &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;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, you can simplify the derivation by recognising integrands as even or odd functions and canceling them accordingly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: 0px&amp;quot;&lt;br /&gt;
|[[File:ia2514_VACF_all2.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 16.&amp;lt;/b&amp;gt; VACF versus time for a Lennard-Jones system in vapour, liquid and solid state]]&lt;br /&gt;
|[[File:ia2514_VACF_mil_all2.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 17.&amp;lt;/b&amp;gt; VACF versus time for a Lennard-Jones system in vapour, liquid and solid state (one million atoms)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The evolution of the velocity autocorrelation function with time is shown in &amp;lt;b&amp;gt;figures 16-17&amp;lt;/b&amp;gt;. In the case of the vapour phase, the VACF decays exponentially with time, indicating a decrease in the correlation between the velocity at time t and the initial velocity which is consistent with the fact that the velocity of a particle is continually changed due to the weak intermolecular forces present in a gas. Due to its highly ordered structure, a solid behaves differently: each particle has its well defined position in the lattice and will mostly just vibrate around it, its movement being dictated by the much stronger interatomic forces than in the case of a gas. A plot of the VACF for a solid is thus expected to exhibit oscillations that decrease in magnitude with time due to disruptions in the ideal oscillatory motion. Having a less ordered structure than a solid, but stronger interatomic forces than a gas, a liquid displays a behaviour that is intermediate between that of a gas and a solid. The plot of the VACF for a liquid therefore exhibits a few damped oscillations, since in a liquid the atoms are not fixed in a lattice and they can diffuse under the influence of the interatomic interactions, unlike in a solid. For both liquids and solids, the minima in the plots represent the time points at which, on average, the atoms collide.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ia2514_VACF2.png|thumb|center|800px|&amp;lt;b&amp;gt;Figure 18.&amp;lt;/b&amp;gt; VACF versus time for a Lennard-Jones system in vapour, liquid and solid state and a harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The VACF for a harmonic oscillator (with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;), calculated using &amp;lt;math&amp;gt;C\left(\tau\right)=cos\left(\omega\tau\right)&amp;lt;/math&amp;gt;, was plotted against the VACF for the liquid and solid Lennard-Jones systems in &amp;lt;b&amp;gt;figure 18&amp;lt;/b&amp;gt;. The most notable difference is regarding the damping of the oscillations: while both the Lennard-Jones solid and liquid oscillations decay for the aforementioned reasons, the harmonic oscillator VACF does not decrease in amplitude since it is an ideal system, with no perturbations disrupting its oscillations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific, what are the perturbations?  Collisions between particles randomise the velocities and make the VACF decay to zero, there are no collisions in the harmonic oscillator.  Look at the equation for the VACF again, when is it negative?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 24===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: 0px&amp;quot;&lt;br /&gt;
|[[File:ia2514_VACFint.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 19.&amp;lt;/b&amp;gt; VACF integral versus time for a Lennard-Jones system in vapour, liquid and solid state]]&lt;br /&gt;
|[[File:ia2514_VACFint_mil.png|thumb|center|400px|&amp;lt;b&amp;gt;Figure 20.&amp;lt;/b&amp;gt; VACF integral versus time for a Lennard-Jones system in vapour, liquid and solid state (one million atoms)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Consistent with the plots of the VACF as a function of time, the graphs of the running integral of the VACF (calculated using &amp;lt;code&amp;gt;scipy.integrate.simps&amp;lt;/code&amp;gt; in Python), shown in &amp;lt;b&amp;gt;figures 19-20&amp;lt;/b&amp;gt;, are all expected to plateau once the VACF has decayed to 0. This plateau occurs relatively early in the case of liquids and solids, whereas for the vapour case, the integral increases significantly and has not visibly plateaued after &amp;lt;math&amp;gt;\Delta t=10&amp;lt;/math&amp;gt;, as expected since the vapour VACF has not completely decayed in this time interval (&amp;lt;b&amp;gt;figures 16-17&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The values of the integrals at t=10 were used as approximations for the plateau value (which represents a good estimate for &amp;lt;math&amp;gt;\int_0^\infty \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \mathrm{d}\tau&amp;lt;/math&amp;gt;) in order to calculate the diffusion coefficient using &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty  \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle \mathrm{d}\tau&amp;lt;/math&amp;gt;. The results are shown in &amp;lt;b&amp;gt;table 5&amp;lt;/b&amp;gt; and they are mostly consistent with the values obtained previously by using the MSD (&amp;lt;b&amp;gt;table 4&amp;lt;/b&amp;gt;). However, the calculated values for the vapour phase, especially in the case of the one million atoms simulation, are expected to be less accurate since the VACF does not decay completely within the simulated time range, affecting the accuracy of the approximation of the integral. The fact that the running integral plot does not plateau is therefore expected to be the largest source of error in this calculation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto;&amp;quot;&lt;br /&gt;
|+&amp;lt;b&amp;gt;Table 5.&amp;lt;/b&amp;gt; Diffusion coefficient calculated using the VACF&lt;br /&gt;
! rowspan=2|Data set!!colspan=3| Diffusion coefficient &lt;br /&gt;
|-&lt;br /&gt;
!Vapour!! Liquid !!Solid&lt;br /&gt;
|-&lt;br /&gt;
|8000/32000 atoms||2.57||9.79x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||-1.14x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|1000000 atoms||3.27||9.01x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||4.52x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, but show the graphs on separate axes so that it&#039;s clear that the solid and liquid integrals have reached a plateau.  The trapezium rule is another possible source of error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
Simulations under various conditions and in different ensembles were run for Lennard-Jones systems in order to extract a range of data: density versus temperature, heat capacity versus temperature, RDF, MSD and VACF. The obtained results were correlated and compared with theory and with the expected behaviour of real systems. The MSD and VACF data was used to calculate the diffusion coefficient and the obtained values were in accordance with previously reported literature values. The relatively high uncertainty in the results obtained for the diffusion coefficient using the VACF was attributed to the approximations made when calculating the VACF integral.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;PhaseDiagram&amp;quot;&amp;gt;J. P. Hansen and L. Verlet, &amp;lt;i&amp;gt;Phys. Rev.&amp;lt;/i&amp;gt;, 1969, &amp;lt;b&amp;gt;184&amp;lt;/b&amp;gt;, 151-161.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Atkins&amp;quot;&amp;gt;P. Atkins and J. Paula, &amp;lt;i&amp;gt;Atkins&#039; Physical chemistry&amp;lt;/i&amp;gt;, Oxford University Press, Oxford, 9th edn, 2010.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&#039;Ballistic&#039;&amp;gt;H. Safdari et al., &amp;lt;i&amp;gt;Phys. Rev.&amp;lt;/i&amp;gt;, 2017, &amp;lt;b&amp;gt;95&amp;lt;/b&amp;gt;, 012120-15.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;MSD&amp;quot;&amp;gt;R. L. Rowley and M. M. Painter, &amp;lt;i&amp;gt;Int. J. Thermophys.&amp;lt;/i&amp;gt;, 1997, &amp;lt;b&amp;gt;18&amp;lt;/b&amp;gt;, 1109-1121.&amp;lt;/ref&amp;gt;&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MLLS17&amp;diff=604049</id>
		<title>Talk:Mod:MLLS17</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MLLS17&amp;diff=604049"/>
		<updated>2017-03-16T18:59:18Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered well, make sure your plots are clear and use multiple plots if it is clearer.  Make sure you understand th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered well, make sure your plots are clear and use multiple plots if it is clearer.  Make sure you understand the background theory behind each task and can use that to explain your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Molecular dynamics simulations of simple liquids=&lt;br /&gt;
&lt;br /&gt;
Many chemical phenomena are studies using computer simulations. Molecular dynamic simulations is a method for studying the physical movements of atoms and molecules. The atoms and molecules are left to interact in given conditions for a set period of time and the dynamic evolution of the system is studied. Practically this can be used to monitor the behavior of protein folding and properties of biological systems such as lipid membranes. &lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamic simulations==&lt;br /&gt;
&lt;br /&gt;
===The Velocity-Verlet Algorithm===&lt;br /&gt;
In the classical particle approximation the Schrodinger equation is used to describe the behavior of any particular chemical system. The limitation to this method is that for anything more complicated than a hydrogen atom, the behavior of the system cannot be solved exactly. Even approximated solutions can be computationally demanding. &lt;br /&gt;
&lt;br /&gt;
In the velocity-verlet Algorithm rather than treating the atomic positions, velocities and forces as continuous functions of time, we break our simulation up into a sequence of timesteps, each of length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
In this exercise the equation of the position of the classical harmonic oscillator &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; was calculated as the &#039;analytical&#039; values. These values were then compared to the values calculated using the velocity-verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:Task1 displacement minji.png|500px|molecule1]]&lt;br /&gt;
! [[image:Task1 energy minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 1: Classical solution for the position (analytical values) against time&lt;br /&gt;
| Figure 2: Total energy of the velocity-verlet solution against time&lt;br /&gt;
|-&lt;br /&gt;
| [[image:Task1 analytical 2 minji final.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 3: Absolute difference between analytical values and velocity-verlet solution against time&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 1 shows the classical harmonic oscillator solution of the position (&amp;quot;ANALYTICAL&amp;quot;) against the time using &amp;lt;math&amp;gt;A = \omega = 1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi=0&amp;lt;/math&amp;gt;. Figure 2 shows the energy against time in which the energy was calculated using the equation &amp;lt;math&amp;gt;E = \frac{1}{2}\ m \ v^{2} + \frac{1}{2}\ k \ x^{2}&amp;lt;/math&amp;gt; which is the kinetic and potential energy of the system respectively. The &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; values were calculated using the velocity-Verlet algorithm. Figure 3 shows the error against time where the error is the absolute difference between the &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution. The position of the classical harmonic oscillator is given by &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;
&#039;&#039;&#039;For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error of the values between the velocity-Verlet and classical oscillator approximated values of the position of particles increased along with the time steps. This can be seen on figure 3 where the plot of the positions of maximum error has been plotted against time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:Task3 energy 0.15 minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:Task3 error 0.15 minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 4: Total energy of the velocity-verlet solution against time with timestep = 0.15&lt;br /&gt;
| Figure 7: The error sgainst time with timesteps = 0.15&lt;br /&gt;
|-&lt;br /&gt;
! [[image:Task3 energy 0.25 minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:Task3 error 0.25 minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 5: Total energy of the velocity-verlet solution against time with timestep = 0.25 &lt;br /&gt;
| Figure 8: The error sgainst time with timesteps = 0.25&lt;br /&gt;
|-&lt;br /&gt;
! [[image:Task3 energy 0.2 minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:Task3 error 0.2 minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 6: Total energy of the velocity-verlet solution against time with timestep = 0.20&lt;br /&gt;
| Figure 9: The error sgainst time with timesteps = 0.20&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figures 4, 5 and 6 shows the energy calculated using the velocity-Verlet solution against time for timesteps 0.15, 0.25 and 0.20 respectively. It showed that as the timestep increased the difference in energy between the maxima and the minima of energy increased and hence the percentage error of the energy also increased. This face is reiterated in figures 7,8 and 9 where it can be seen that the maximum error values become more frequent and greater as the timestep increases. &lt;br /&gt;
&lt;br /&gt;
An estimation of the percentage error of the energy over the time of the simulation is shown on the table figure 10.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!  [[image:Error table 2 minji.png|center|250px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 10 shows a few of the percentage errors that were calculated. It can be seen that a timestep of 0.002 is needed for the total energy to not change over 1%.&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of a physical system when modelling its behaviour numerically because it can be indicative of whether the law of conservation energy is in action and also that the system is in thermal equilibrium. Both these must be met so that the behavior of the system can be calculated and compared to other systems numerically. The numerical thermodynamic properties derived from these values will be different if the law of conservation energy and thermal equilibrium are not met. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and explanation - assuming you mean 0.2?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic force and the Lennard Jones Potential===&lt;br /&gt;
&lt;br /&gt;
The forces acting on a given configuration fo atoms cannot be reasonably solved using quantum physics equations. Therefore approximations must be made. In classical physics the force acting on an object is determined by the potential that it experiences. &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \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;
The function U defines all the key physics of interatomic interactions in a system. The Lennard Jones potential can be used to model the interactions between each pair of atoms. Overall U is given by the equation;&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;
&#039;&#039;&#039;1. For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&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{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} = 0&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{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\sigma}^6 = r^6 &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;{\sigma} = r_{0} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the phase separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;{\sigma}&amp;lt;/math&amp;gt; when the potential energy is zero.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. What is the force at this separation?&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \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;
&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;
Therefore&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}}{dr}\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;\mathbf{F}_i = -\sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{-12\sigma^{12}}{r_{ij}^{13}} + \frac{6\sigma^6}{r_{ij}^7} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = r_{0} &amp;lt;/math&amp;gt; as &amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = \left\{ -4\epsilon \left( \frac{-12}{\sigma} + \frac{6}{\sigma} \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;\mathbf{F}_i = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at the separation where the potential energy is zero is therefore &amp;lt;math&amp;gt;\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. 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;)&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a stationary point in the Lennard Jones potential. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;-4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right) = 0 \ &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{12\sigma^{12}}{r^{13}} = \frac{6\sigma^6}{r^7}&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;{2\sigma^{6}} = {r^6}&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;{r_(eq)} = {2^\frac{1}{6}}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then for the well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r_(eq)}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{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;U\left(\mathbf{r_(eq)}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \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;U\left(\mathbf{r_(eq)}^N\right) = -\epsilon &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore at equilibrium distance the well depth is equal to &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. 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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right)\mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) \mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4.1 &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)|_{2\sigma}^{\infty} = = 0 - 4\epsilon \left( \frac{\sigma^{12}}{-11\left({2\sigma}\right)^{11}} - \frac{\sigma^6}{-5\left({2\sigma}\right)^5} \right) = -0.0248 (3.s.f)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.2 &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)|_{2.5\sigma}^{\infty} = 0 - 4\epsilon \left( \frac{\sigma^{12}}{-11\left({2.5\sigma}\right)^{11}} - \frac{\sigma^6}{-5\left({2.5\sigma}\right)^5} \right)= -0.00818 (3.s.f)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4.3 &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right)|_{3\sigma}^{\infty} = 0 - 4\epsilon \left( \frac{\sigma^{12}}{-11\left({3\sigma}\right)^{11}} - \frac{\sigma^6}{-5\left({3\sigma}\right)^5} \right) = -0.00329 (3.s.f)&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integral of the Lennard Jones potential corresponds to the force interaction between two atoms. The different integral boundary conditions shows that as the difference between the upper an lower boundary condition increases the force interaction between the two atoms tends to zero. This illustrates how as the distance between two atoms increases the interaction decreases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The force is the derivative of the potential, not the intergal.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic boundary conditions===&lt;br /&gt;
The tasks will illustrate why it is not possible to simulate realistic volumes of liquid, with the number of atom,&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;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Estimate the number of water molecules in 1 ml of water under standard conditions.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Density of water = &amp;lt;math&amp;gt;1 \frac{g}{cm^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
Molar mass of water = &amp;lt;math&amp;gt;18 \frac{g}{mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of water in 1 mL = &amp;lt;math&amp;gt;1 \frac{g}{cm^{3}} \times 1 mL = 1g&amp;lt;/math&amp;gt; Therefore the&lt;br /&gt;
number of moles in 1 mL = &amp;lt;math&amp;gt;\frac{1}{18} mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number of water molecules in 1 mL = &amp;lt;math&amp;gt;6.023 \times 10^{23} \times \frac{1}{18} mol= 3.35 \times 10^{22} (3.s.f) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the previous task if there are &amp;lt;math&amp;gt;3.35 \times 10^{22}&amp;lt;/math&amp;gt; water molecule in 1 mL, 10000 water molecules occupy a volume of &amp;lt;math&amp;gt;1 mL \times \frac{10000}{3.35 \times 10^{22}} = 2.99 \times 10^{-19} mL  (3.s.f)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 1mL of water which is a volume that an be used in labs and hence is considered realistic. However as calculated there are far too many water molecules to simulate all of them. Even when simulating 10,000 water molecules this only represents &amp;lt;math&amp;gt;2.99 \times 10^{-19} mL&amp;lt;/math&amp;gt; which is not a realistic volume. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. 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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Position before periodic boundary conditions applied = &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right) + \left(0.7, 0.6, 0.2\right) = \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Position after periodic boundary conditions applied = &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The atoms are enclosed in a box of fixed dimensions. The periodic boundary condition is applied to ensure that when an atom passes out the boundary another atom passes through into the boundary so that the number of atoms in the box stays constant.&lt;br /&gt;
&lt;br /&gt;
===Reduced units===&lt;br /&gt;
&lt;br /&gt;
When using the Lennard Jones potential reduced units are used in order to make the values more manageable. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;.&#039;&#039;&#039; &lt;br /&gt;
&#039;&#039;&#039;1. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = 3.2 \times 0.34 \times 10^{-9} = 1.09 \times 10^{-9} m = 1.09 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;U\left(\mathbf{r_(eq)}^N\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = -120K \times 1.38 \times 10^{-23} = 1.66 \times 10^{-21} J (3.s.f) = 0.997 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
In order to start a simulation the initial states of all the atoms in the system must be known. For a crystal this would be straight forward however generating coordinates for a liquid is more difficult. There is no long range order therefore there cannot be a reference point in order to work out the points of all the other atoms. We could create random positions for each atom however this may cause problems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
This may cause problems because if two atoms happen to be generated close together the coordinates could overlap. This will cause problems with defining some properties of the atoms. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific.  Overlapping atoms will cause high repulsive forces which make the simulation unstable and can cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Volume} = 1.07722^{3} = 1.25 unit^{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Number density} = \frac{\text{Number of lattice points per unit cell}}{\text{Unit volume}} = \frac{1}{1.25} = 0.8 (1.d.p)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.2 = \frac{\text{Number of lattice points per unit cell}}{\text{Unit volume}} = \frac{4}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Volume of cubic unit cell}= \frac{4}{1.2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Side Length of the cubic unit cell}= \sqrt[3]{\frac{4}{1.2}} = 1.49 (3.s.f) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice has one lattice point per unit cell whereas a face-centred cubic lattice has 4 lattice points per unit cell. Therefore if in the simple cubic lattice 1 box creates 1000 atoms in a face-centered lattice 1 box will create 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atom===&lt;br /&gt;
&lt;br /&gt;
The physical properties of the atoms must also be known as well as their positions in order to perform the simulations. For the simulations all the atoms are set with the same mass and same.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;: This line is defining an atom of type &#039;&#039;&#039;1&#039;&#039;&#039; with a mass &#039;&#039;&#039;1.0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;: This is a set of formula(s) used to compute pairwise interactions. In LAMMPS, the pair potential is defined within a cutoff distance and the set of active interactions change over time. Therefore this code defines the cutoff as a distance of 3.0. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;: Specifies the pair wise force field interaction for one or more atom types. The two asterisks correspond to two atoms of any type in the system. The two numbers at the end correspond to two coefficients in this case &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do we use a cutoff for the potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
So far we have said that there are 1000 atoms in the box and the starting position for all the atoms are defined. We have also set all their masses and calculated the interaction between pairs of atoms. We have to finally specify the velocity of each atom.&lt;br /&gt;
&lt;br /&gt;
At equilibrium the velocities of the atoms are distributed by the Maxwell-Boltzmann distribution. The velocity can be found if the masses and and temperature of simulation is known.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a timestep of 0.001, run ${n_steps} is used to calculate how many runs to carry out. It is more efficient to set the number of runs to 100000, especially when running simulations at several different timesteps.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why is it better to use variables to define the values of simulation parameters?  In this case what happens if we want to change the timestep?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:TotEng 0.001 minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:Temp 0.001 minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 11: A plot of total energy against time for a 0.001 timestep experiment&lt;br /&gt;
| Figure 12: A plot of temperature against time for a 0.001 timestep experiment&lt;br /&gt;
|-&lt;br /&gt;
! [[image:Pressure 0.001 minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 13: A plot of the pressure against time for a 0.001 timestep experiment&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Does the simulation reach equilibrium? How long does this take?&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Figure 11, 12 and 13 show that the simulations for Total energy, temperature and time all reach equilibrium rapidly. &lt;br /&gt;
The total energy reaches equilibrium at approximately -3.184 at time 0.38.&lt;br /&gt;
The temperature reaches equilibrium at approximately 1.24 at time 0.27. &lt;br /&gt;
The pressure reaches equilibrium at approximately 2.6 at time 0.17. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report).&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:Totalenergy alltimesteps minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 14: Total energy against time for varying timesteps&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be seen on figure 14 for timesteps 0.015, 0.01 and 0.0075 the thermal equilibrium is not reached within the timescale. For timestep 0.015 there is a constant increase therefore is a particularly bad choice. For timestep 0.01 an 0.0075 there is a constant decrease therefore is not an acceptable timestep to use. For timesteps 0.001 and 0.0025, the equilibrium is reached within the timescale of the simulation. Out of these 0.001 will give more accurate results for the simulation. On the other hand the timestep 0.0025 will be useful for observing the system for a larger period of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The energy for 0.01 and 0.0075 looks roughly constant, but these timesteps are not suitable because the average energy should not depend on the choice of timestep.  0.0025 and 0.001 give the same average energy, so choose 0.0025 so that the simulation can cover more time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
Ensembles are used in statistical thermodynamics to describe different sorts of experimental conditions. A chemists we often use the isobaric-isothermal ensemble. In this section we are going to run simulations under the NpT conditions and sketch an equation of state for our model fluid at atmospheric pressure. &lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The equipartition theorem in statistical thermodynamics 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 the system if there are &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with 3 degrees of freedom therefore we can write two equations:&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i\gamma)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation shows the modified velocity to give the desired energy from the target temperature. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{1}{2}\sum_i m_i (v_i)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma =  \pm\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; changes varies depending on whether the kinetic energy of the system is too high or low. If the kinetic energy and temperature is higher than the target energy and temperature &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be lowered and vice versa. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.  Take the positive root since gamma should only scale the magnitude of the velocities, not reverse them.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. What is the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three numbers 100, 1000 and 100000 represent Nevery, Nrepeat and Nfreq respectively. It defines the timesteps of the input values that will be used for the average. &lt;br /&gt;
&lt;br /&gt;
Nevery: The spacing between the timestep values that will be used in the average.&lt;br /&gt;
&lt;br /&gt;
Nrepeat: How many input values will be chosen to calculate the average.&lt;br /&gt;
&lt;br /&gt;
Nfreq: The calculation of averages every Nfreq timestep. &lt;br /&gt;
&lt;br /&gt;
The temperature for the average will be sampled every 100000 timestep with a 100 timestep interval. 1000 measurements contribute to the average. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Total time} = 100000 \times 0.0025 = 250 \text{time units} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Plotting the equations of state===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^* = 1.5, 1.6, 1.7, 1.8, 1.9&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;P = 2.6, 2.7&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was chosen on the basis of the results from the previous seciton.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:Density temp minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:Density temp idealgas minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 11: Density against reduced temperature with standard error error bars&lt;br /&gt;
| Figure 12: Density against temperature comparative to the ideal gas derived values&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot shows that as the temperature increase the density decreases which is due to the expansion of the material. As the systems is heated the particles will gain kinetic energy which will cause more frequent collisions with the wall. Despite the more frequent collisions the pressure stays constant. This shows that the surface area of the walls has increased hence the volume increased and density decreased.&lt;br /&gt;
 &lt;br /&gt;
By combining the simulation results and the theoretical values derived from the ideal gas equation it can be seen that the simulated density is much lower. This is because the ideal gas theory assumes that there are no interactions between the particles. With this assumption the particles are able to be much closer together in the system hence would have much higher densities. Although there are attractive and repulsive interactions within a non-ideal system the repulsive forces have a greater contribution than the attractive forces therefore overall the repulsive forces will cause the system to be less dense than the ideal gas system. The ideal gas theory only works in low-density and hence low pressure systems where the interaction between the particles are minimal. Therefore as the pressure increases and the system becomes denser the discrepancy between the ideal gas derived values and the simulations would increase.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation, the discrepancy with results also gets smaller as temperature increases.  Why have you fitted a straight line to the ideal gas results?  The ideal gas equation shows that density is proportional to 1/T. &amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
===Heat capacity calculations===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Densities: 0.2, 0.8&lt;br /&gt;
&lt;br /&gt;
Temperatures: 2.0, 2.2, 2.4, 2.6, 2.8&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities. Is the trend the one you would expect?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:HeatCapacity temp minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 13: &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature of two densities&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 13 shows how the Heat Capacity/Volume of simulating cell varies with temperature for densities 0.2 and 0.8. For both densities the Heat Capacity/Volume decreases as the temperature increases. &lt;br /&gt;
&lt;br /&gt;
The equation of the heat capacity of an ideal gas is derived from statistical thermodynamics as: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_\text{V} = \left(\frac{\partial U}{\partial T}\right)_\text{V} = \frac{3}{2}nR&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{PV}{T} = nR&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_\text{V} = \frac{3}{2} \frac{PV}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_\text{V}}{V} = \frac{3}{2} \frac{P}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Pressure is constant therefore in theory &amp;lt;math&amp;gt;\frac{C_\text{V}}{V}&amp;lt;/math&amp;gt; and Temperature is inversely proportional which is was is observed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What function have you used to fit the heat capacity data?  Can you explain why the heat capacity is higher at higher density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE DENSITY ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve &lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp atoms vol&lt;br /&gt;
variable eng equal etotal&lt;br /&gt;
variable eng2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_eng v_eng2 v_temp v_temp2  &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable aveeng equal f_aves[1]&lt;br /&gt;
variable aveeng2 equal f_aves[2]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable cv equal ${n2}*(${aveeng2}-${aveeng}*${aveeng})/(${avetemp}*${avetemp}) &lt;br /&gt;
variable cv2 equal (${n2}*(${aveeng2}-${aveeng}*${aveeng})/(${avetemp}*${avetemp}))/vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${density}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V : ${cv2}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
In this section we are going to caracterise the structure of a system that is simulated using the radial distribution function, &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt;. This is going to be done using the VDM. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:RDS distance minji.png|center|500px|molecule1]]&lt;br /&gt;
! [[image:IntegralRDS distance minji.png|center|500px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 14: The Radial distribution against the distance of solid, liquid and gas&lt;br /&gt;
| Figure 15: The integral of the RDF against the distance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
The radial distribution function, g(r) in a system of particles shows the probability of finding particles within a shell of distance r away from a reference atom.&lt;br /&gt;
&lt;br /&gt;
In figure 14, at small distances, the RDF is zero for solid, liquid and gases due to the inter atomic repulsion at these distances. &lt;br /&gt;
&lt;br /&gt;
Also, the solid has a large number of peaks due to long range order of the system. The fact that it has lots of peaks suggests the system has a large density. &lt;br /&gt;
&lt;br /&gt;
Again, looking at figure 14, for gases and liquids the equilibrium RDF (where the line becomes horizontal) signifies the region where the probability of finding a particle from a reference point is the same. This would be when the particles are more or less equally distributed. The region between RDS = 0 and where equilibrium is reached, corresponds to when the particles are affected by the Lennard Jones potential and hence the probability varied slightly depending on whether the attractive or repulsive forces dominate. For liquids and gases there are very little peaks corresponding to short range order. The peaks are also smooth due to the molecular dynamics of the system. &lt;br /&gt;
&lt;br /&gt;
Figure 15 shows the integration of g(r) against the distance. The integral of the RDF gives an idea of the average coordination number. Figure 15 shows that the coordination number of solids are greatest and the is lowest for gases. In reality coordination numbers are only significant in solids. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The RDF is normalised so the number of peaks doesn&#039;t necessarily indicate the density of the system.  The peaks indicate that the liquid has short range order, and the solid has long range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:Fcc annotated minji.png|center|300px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 16&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 16 shows the lattice points that the distances of the first three peaks on the solid radial distribution function corresponds to. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
| lattice point 1&lt;br /&gt;
| lattice point 2&lt;br /&gt;
| lattice point 3&lt;br /&gt;
|-&lt;br /&gt;
| Distance&lt;br /&gt;
| 1.025&lt;br /&gt;
| 1.475&lt;br /&gt;
| 1.825&lt;br /&gt;
|-&lt;br /&gt;
| Coordination number&lt;br /&gt;
| 12&lt;br /&gt;
| 6&lt;br /&gt;
| 24&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is the spacing between two lattices which is the distance between the reference atom and lattice point 2. This is 1.475 unit distance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to show the which atoms are responsible for the first three peaks on a diagram of an fcc lattice.  Did you get the coordination numbers from the integral of the RDF?  You could have calculated the lattice parameter from each of the first three peaks and then calculated an average rather than just taking the value of the second peak.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamic properties and the diffusion coefficient==&lt;br /&gt;
In this section, we are going to characterise the diffusion coefficient to get an idea of how the atoms move about in the simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Make a plot for each of your simulations, showing the mean squared displacement as a function of timestep. Are these as you would expect?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:MSD simulation graph 2 minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 17: A plot of the mean square displacement as a function of timestep of simulations&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement is a measure of the deviation time between the position of a particle and some reference position.&lt;br /&gt;
&lt;br /&gt;
As the time progresses it is expected that the position of a particle and some reference position would increase as it diffuses. This explains why there is a positive correlating line for solids, liquids and gases in figure 17. The gradient of the line correponds to &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;. The equation &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; is then used to obtain the diffusion coefficient. The diffusion coefficient gives an indication of the diffusion mobility. It can be seen that the gradient of the lines and hence the diffusion coefficient changes with the trend D(solid) &amp;lt; D(Liquid) &amp;lt; D(Gas). This is the expected trend as gas particles have a greatest diffusion mobility as gas systems have the lowest density. On the contrary solids have the lowest diffusion mobility as the particles in solids are in a fixed lattice and hence shows very little to no diffusion. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:MSD millionatom graph 2 minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 18: A plot of the mean square displacement as a function of timestep of a million atoms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plot the different phases on separate plots so that they are easier to see.  Do you know why the gas phase MSD begins as a curved line (ballistic motion)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate 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}1&amp;lt;/math&amp;gt; -(1)&lt;br /&gt;
&lt;br /&gt;
From the 1D Harmonic Oscillator:&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;
&amp;lt;math&amp;gt; v\left(t\right) = \frac{\partial \left( x\left(t\right)\right)}{\partial t} = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; -(2)&lt;br /&gt;
&lt;br /&gt;
Substitute (2) into (1)&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\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;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \sin \left(\omega t + \omega \tau +\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;
&lt;br /&gt;
Using &amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \omega\tau + \phi\right) = \sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\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;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\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;C\left(\tau\right)= \cos\left(\omega \tau\right) + \frac{\int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\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;C\left(\tau\right)= \cos\left(\omega \tau\right) + \frac{\int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \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;\sin(x) = \text{odd function}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\cos(x) = \text{even function}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{odd function} \times \text{even function} = \text{odd function}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin(x)\cos(x) = \text{odd function}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \frac{\int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)\mathrm{d}t} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, clear derivation and well spotted that you can avoid the integration by noticing that the integrand is an odd function.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:VACF graph minji.png|center|600px|molecule1]]&lt;br /&gt;
! [[image:VACF graph gas minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 19&lt;br /&gt;
| Figure 20&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A single atom at time zero has a certain velocity. If the atoms in the system do not interact with each other, due to conservation of energy the atom would retain this velocity.Therefore without the interaction between atoms the graph would just show a horizontal line. In low density systems, like gases, where the interaction between the atoms are very small, we would expect a gradual decrease in velocity as shown in figure 20. In high density systems such as solids and liquids where the interaction and forces between the atoms are strong, the atoms seek locations where there is a balance between the repulsive and attractive forces, as this is where the atom is most energetically stable. In solids the locations of the atoms are very stable hence they do not move far from their position. The oscillations will oscillate back and forth, reversing their velocity at each end. This is where the approximated graph in figure 19 comes from. The oscillations in the solid are damped by the perturbative forces acting on the atoms. Liquids are similar to solids however as the atoms in liquids are more diffusive the oscillatory motion is rapidly damped. The minima on the solid and the liquid represent the highest velocity of the damped oscillation in the opposite direction to where it started. The harmonic oscillator VACF is very different from the Lennard Jones solid and liquid because the harmonic oscillator assumes that there is a conservation in energy whereas the lennard Jones solid and liquid takes into account the interactions between the particles. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the perturbative forces that cause the solid VACF to decay?  The shape of the VACF is not due to conservation of energy, it is due to collisions between particles which randomise the velocities and cause the VACF to decorrelate.  There are no collisions in the harmonic oscillator so no collisions.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:VACF integral sim minji.png|center|600px|molecule1]]&lt;br /&gt;
! [[image:VACF integral million minji.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 21: Integral of VACF against time &lt;br /&gt;
| Figure 22: Integral of VACF against time for a million atoms&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[image:VACF integral sim liqsol jane.png|center|600px|molecule1]]&lt;br /&gt;
! [[image:VACF integral million liqsol jane.png|center|600px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 23: Integral of VACF against time of liquid and solid only&lt;br /&gt;
| Figure 24: Integral of VACF against time for a million atoms of liq and solid only&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figures 23 and 24 is the integral value versus the time. It shows the cumulative integral value of the velocity auto-correlation function as the time increases. Figure 20 shows that there area under the curve decreases per timestep which explains why the integral value of the gas shown in figure 21 shows an increases and plateaus. The integral value of the solid is near to zero through the timesteps because the areas on positive and negative areas on figure 19 cancel out. For the liquid graph, the an sharp increase in the integral value at the start comes from the positive area under the graph at the start on figure 19. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients from the VACF graphs are calculated using the equaiton:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
![[image:Table lastsection 2 minji.png|center|400px|molecule1]]&lt;br /&gt;
|-&lt;br /&gt;
| Figure 25: diffusion coefficient (units: area/time)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figure 25 shows the calculated diffusion coefficients from the mean squared distance over time graph and the velocity auto-correlation function graph. Earlier it was estimated by looking at the gradients of figure 17 that the diffusion coefficients followed the trend D(solid) &amp;lt; D(Liquid) &amp;lt; D(Gas). This statement is reinforced by the diffusion coefficients in the table. The diffusion coefficients obtained using the velocity auto-correlation function gives larger values than those calculated using the mean squared distance. The largest error comes from the trapezium rule which over estimates the area under the curve.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Again show the different phases on different plots.  This approach to calculating the diffusion coefficient from the VACF is only valid if the integral has converged within the simulation time so this is another possible source of error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:YJJ14&amp;diff=604037</id>
		<title>Talk:Mod:YJJ14</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:YJJ14&amp;diff=604037"/>
		<updated>2017-03-16T18:53:14Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered and results look good.  Try to expand your written answers more though and use the background theory behind...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered and results look good.  Try to expand your written answers more though and use the background theory behind the experiment to explain your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Molecular Dynamics: Simulation of Liquids ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Velocity Verlet Equation ===&lt;br /&gt;
When applying the Velocity Verlet Equation, it is possible to achieve a good estimate of the positions and velocity of simple liquid particles by varying the timesteps. The following graphs (Figures 1-4) are plotted from data with a timestep of 0.1.&lt;br /&gt;
&lt;br /&gt;
[[File:0.1position.PNG|600px|thumb|none|&#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Position varying with time.]]&lt;br /&gt;
Figure 1 shows that the Velocity-Verlet Equation gives a good estimate of the positions when compared to the analytical positions of a harmonic oscillator &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. The coefficients &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;\Omega&amp;lt;/math&amp;gt; are set to 1 and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is set to 0.&lt;br /&gt;
[[File:0.1error.PNG|600px|thumb|none|&#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Absolute error of between x(t) and analytical positions.]]&lt;br /&gt;
Figure 2 shows the absolute error of positions calculated from the Velocity-Verlet Equation and the positions calculated from a classical harmonic oscillator. Figure 3 shows a linear plot of the maximum absolute errors against time. It can be seen that the error is slowly increasing and should a longer period of time pass, the simulated system will less accurate.&lt;br /&gt;
&lt;br /&gt;
[[File:0.1errorlinear.PNG|500px|thumb|none|&#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Plot of Maximum Absolute Error in position showing a linear trend.]]&lt;br /&gt;
&lt;br /&gt;
[[File:0.1energy.PNG|600px|thumb|none|&#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Total Energy from Velocity-Verlet Algorithm varying with time.]]&lt;br /&gt;
Here the total energy, &amp;lt;math&amp;gt;E_{total}=E_p+E_k&amp;lt;/math&amp;gt;, is calculated using:&amp;lt;blockquote&amp;gt;&amp;lt;math&amp;gt;E_p=\tfrac{1}{2}kx^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_k=\tfrac{1}{2}mv^2&amp;lt;/math&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Where &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; are given as 1. The values &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; are estimated with the Velocity-Verlet Equation. It is important that the fluctuation in error calculated here is small, as the total energy of a real system should not change. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To determine the timestep that is required for the total energy to have less than 1% of fluctuation, trial and error showed that the timestep to achieve small fluctuations in energy in the simulation is &#039;&#039;&#039;0.2&#039;&#039;&#039;. &amp;lt;br&amp;gt;This number is large enough so an acceptable amount of time can be run in the simulation, and is small enough so the total energy does not drastically change. It is important that the system simulated is has little change in total energy so the other properties that are measured have a physical significance.&lt;br /&gt;
&lt;br /&gt;
Table 1, shown below, gives a range of timesteps and their associated percentage change in total energy. While Figures 5 to 8 show plots of the fluctuations of total energies for the selected timesteps.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Table 1 - Percentage Changes in Total Energy&lt;br /&gt;
! Timestep!! Percentage %&lt;br /&gt;
|-&lt;br /&gt;
! 0.05&lt;br /&gt;
| &amp;lt;center&amp;gt;0.06&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0.10&lt;br /&gt;
| &amp;lt;center&amp;gt;0.25&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0.20&lt;br /&gt;
| &amp;lt;center&amp;gt;1.00&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! 0.25&lt;br /&gt;
| &amp;lt;center&amp;gt;1.57&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Timestep0.05.png|400px|thumb|none|&#039;&#039;&#039;Figure 5:&#039;&#039;&#039; Graph showing the fluctuation in total energy with a timestep of 0.05 ]]&lt;br /&gt;
| [[File:Timestep0.1.png|400px|thumb|none|&#039;&#039;&#039;Figure 6:&#039;&#039;&#039; Graph showing the fluctuation in total energy with a timestep of 0.10]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Timestep0.20.png|400px|thumb|none|&#039;&#039;&#039;Figure 7:&#039;&#039;&#039; Graph showing the fluctuation in total energy with a timestep of 0.20]] &lt;br /&gt;
|[[File:Timestep0.25.png|400px|thumb|none|&#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Graph showing the fluctuation in total energy with a timestep of 0.25]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?  Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
==== Separation where potential energy is zero ====&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, for a single LJ interaction where the potential energy is zero is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} = \frac{\sigma^6}{r^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{6}}{r^{6}} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{r_0 = \sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Force when potential energy is zero ====&lt;br /&gt;
&lt;br /&gt;
The force, &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt;, at the separation &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt; is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
&lt;br /&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;&lt;br /&gt;
&lt;br /&gt;
Substitute,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}\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\}}{\mathrm{d\mathbf{r}_i}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Differenciate wrt &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  -\sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( -\frac{12\sigma^{12}}{r_{ij}^{13}} +  \frac{6\sigma^6}{r_{ij}^7} \right)\right\}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =\sum_i^N \sum_{i \neq j}^{N} \left\{ 24\epsilon \left( \frac{2\sigma^{12}}{r_{ij}^{13}} -  \frac{\sigma^6}{r_{ij}^7} \right)\right\}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;r_{ij} = \sigma&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Equilibrium Separation and well depth ====&lt;br /&gt;
&lt;br /&gt;
Equilibrium Separation occurs when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i} =  24\epsilon \left( \frac{2\sigma^{12}}{r^{13}} -  \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \left( \frac{2\sigma^{12}}{r^{13}} -  \frac{\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore  \frac{2\sigma^{12}}{r^{13}} =  \frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And has a value of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the equilibrium distance, the well depth is found by substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; into &amp;lt;math&amp;gt;\phi \left(r\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi \left(r_{eq}\right) = -\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==== Evaluating Integrals ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int \phi\left(r\right) \mathrm{d}r = \int 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) \mathrm{d}r &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = 4\epsilon \left( \frac{\sigma^{12}}{-11r^{11}} - \frac{\sigma^6}{-5r^5} \right) + C &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &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 \approx -2.48 \times 10^{-2}&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 \approx -8.18 \times 10^{-3} &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 \approx -3.29 \times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
Realistic volumes of liquid cannot be simulated, as they involve many more particles than the usual simulated range of 1000 to 10000 particles.&lt;br /&gt;
&lt;br /&gt;
An example is to show the number of water molecules in 1 mL of water under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1\ \mathrm{mL} = 1\ \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number of moles in 1 mL of water: &amp;lt;math&amp;gt;\frac{1\ \mathrm{g}}{18\ \mathrm{g\ mol^{-1}} } = 5.56 \times 10^{-2}\  \mathrm{mol}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Esimated number of molecules in 1 mL of water: &amp;lt;math&amp;gt;5.56 \times 10^{-2}\ \mathrm{mol} \times 6.022 \times 10^{23}\  \mathrm{mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;=\ 3.35 \times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In comparison, the estimated volume of 10000 water molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Estimated volume for 10000 water molecules: &amp;lt;math&amp;gt;\frac{10000}{6.022\times 10^{23}} \times 18 = 2.99 \times 10^{-19}\ \mathrm{mL}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the volume of simulated water is so drastically different, periodic boundary conditions are applied to better approximate a bulk liquid. This is done by pretending the simulation box is repeated infinitely in all directions, so none of the atoms in the box at the edges are exposed to a vacuum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In a cubic box that runs from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt;. An atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; runs along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;. within one timestep it ends up at &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt; after applying periodic boundary conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
It is typical when using Lennard-Jones interactions to work in reduced units, so the results are much more manageable. Reduced units are denoted by a star, and they take the following conversion factors:&lt;br /&gt;
&lt;br /&gt;
Distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;, Energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;, Temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\ \mathrm{nm}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \epsilon\ /\ k_B= 120\  \mathrm{K}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, in real units:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\times\sigma=3.2\times0.34&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=1.088\ \mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;T = T^* \times \frac{\epsilon}{k_B}=1.5 \times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 180\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = \frac{k_BT \times \mathrm{N_A}}{T^* \times 1000} = \frac{1.38 \times 10^{-23} \times 180 \times 6.022 \times 10^{23}}{1.5 \times 1000}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998\ \mathrm{kJ\ mol^{-1}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Creating the simulation box ===&lt;br /&gt;
When two atoms are given random starting coordinates, there is a probability that they will be generated very close together. This can be problematic as it would cause an infinitely high potential to form. This means that it will be difficult to equilibrate during the timescale of the simulation and so may be unable to provide any useful physical properties.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The high repulsive forces that could be generated make the simulation unstable and can cause it to crash without reducing the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In a simple cubic cell, if the distance between lattice points is 1.07722, the number density can be calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Number density} = \frac{\text{Lattice points}}{\text{Volume of unit cell}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point in a unit cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Number denisty} = \frac{1}{1.07722^3} = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For a face-centred lattice with a lattice point density of 1.2, the length of the unit cell is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {Length of unit cell} = \sqrt[3]{\text {Volume of unit cell}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Volume of unit cell} = \frac{\text{Lattice points}}{\text{Number density}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 4 lattice points in a face centred cubic cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\text {Length of unit cell} = \sqrt[3]{\frac{4}{1.2}}= 1.49\ 3sf&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
With a face-centred cubic lattice, create_atoms command would create 4 times as many atoms in a box than when using a simple cubic lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Setting the properties of the atoms ===&lt;br /&gt;
&lt;br /&gt;
The purpose of the following commands in the input script can be found using the LAMMPS manual.&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;
 mass 1 1.0 &lt;br /&gt;
This command means that you are defining the mass of the atoms. With a type 1 and with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
This command means that your are simulating paired interactions using a Lennard-Jones potential and cutting off at a distance of 3.0&lt;br /&gt;
&lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
This command defines some of the other coefficients for the simulation. The asterisks correspond to two atoms of any type. The numbers at the end correspond to thecoefficients &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
As we have specified &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, the integration algorithm that we can use is the Velocity-Verlet Algorithm as it will update the position each timestep and the velocity each half-step.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, why is a cutoff used with this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Running the simulation ===&lt;br /&gt;
&lt;br /&gt;
Figure 9 shows two different formats of command that should both run 100000 steps during a simulation. &lt;br /&gt;
&lt;br /&gt;
{| class=&#039;wikitable&#039;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|colspan=2|&#039;&#039;&#039;Figure 9: &#039;&#039;&#039; Two different formats of command that should achieve the same output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The command on the left can easily change the number of steps that it will take during a simulation for a certain timestep.&lt;br /&gt;
&lt;br /&gt;
For example, this specific command shows that a timestep of 0.001 would run 100000 steps. If the timestep was changed to 0.01, the code would automatically calculate the number of steps to be 10000. Both timesteps will eventually run for a total time of 100. This cannot be achieved for the command on the right.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Using variables makes it easier to change parameters of the simulation as all commands which depend on those parameters are updated automatically.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibrium ===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[file:Totalenergy_t_0.001.png|500px|thumb|&#039;&#039;&#039;Figure 10: &#039;&#039;&#039;Graph of total energy against time, timestep: 0.001]]&lt;br /&gt;
|[[file:Temperature_t_0.001.png|500px|thumb|&#039;&#039;&#039;Figure 11: &#039;&#039;&#039;Graph of temperature against time, timestep: 0.001]]&lt;br /&gt;
|-&lt;br /&gt;
|[[file:Pressure_t_0.001.png|500px|thumb|&#039;&#039;&#039;Figure 12: &#039;&#039;&#039;Graph of pressure against time, timestep: 0.001]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Figures 10, 11 and 12 show that equilibrium is reached very rapidly.&lt;br /&gt;
* For Total Energy this takes a time of approx: 0.14&lt;br /&gt;
* For Temperature this takes a time of approx: 0.30&lt;br /&gt;
* For Pressure this takes a time of approx: 0.40&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Figure 13 shows a graph of all the total energies for all the simulated timesteps, 0.001, 0.0025, 0.0075, 0.01 and 0.015.&lt;br /&gt;
[[File:total_energy_varying_timesteps.png|1000px|thumb|none|&#039;&#039;&#039;Figure 13: &#039;&#039;&#039; Graph of the total energies for the timesteps: 0.001, 0.0025, 0.0075, 0.01 and 0.015.]]&lt;br /&gt;
&lt;br /&gt;
From these timesteps, it can be seen that the largest timestep that still gives acceptable results is the timestep of 0.01.&lt;br /&gt;
The worst results occur from the timestep of 0.015, as the total energy simulated from this timestep increases linearly after a short attempt at equilibrating.&lt;br /&gt;
&lt;br /&gt;
However the best timestep to use for future simulations would probably be 0.0025. This timestep achieves the lowest equilibrated energy along with the timestep 0.001.  A timestep of 0.0025 would be better because it can simulate for a longer period of time than 0.001, with the best balance.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the timestep so 0.0075 and 0.01 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
We can change the ensemble of a simulation to measure other properties of a system. In this section the simulations will be run under NpT (isobaric-isothermal) ensembles.&lt;br /&gt;
&lt;br /&gt;
The parameters used in the simulation are two different pressures of 2.5 and 3.0 and temperatures 1.5, 1.7, 1.9, 2.1 and 2.3. All the simulations are run with a timestep of 0.0025, which was the previously determined timestep that gives the best balance between length of simulation and accuracy in results.&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
&lt;br /&gt;
To get the target temperature, each velocity will have to by multiplied by the constant factor, &amp;lt;math&amp;gt;\gamma&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;
Multiply each velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;, substituting this into the equation gives:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 \frac{1}{2}\sum_i m_i  v_i^2 =\gamma^2 \frac{3}{2} N k_BT= \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can be simplified and rearranged to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 T= \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \pm\sqrt{ \frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examing the Input Script ===&lt;br /&gt;
&amp;lt;pre&amp;gt;### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three number 100, 1000 and 100000 are the arguments for &amp;lt;i&amp;gt;Nevery&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Nrepeat&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Nfreq&amp;lt;/i&amp;gt; respectively. They determine what timesteps the input values will be used in the average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;i&amp;gt;Nevery&amp;lt;/i&amp;gt;&#039;&#039;&#039;: Number of timesteps between every input number that will be used in the calculation of an average.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;i&amp;gt;Nrepeat&amp;lt;/i&amp;gt;&#039;&#039;&#039;: This number refers determines how many input values are averaged. The input values used are the timesteps &amp;lt;i&amp;gt;Nrepeat&amp;lt;/i&amp;gt; before the &amp;lt;i&amp;gt;Nfreq&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;i&amp;gt;Nfreq&amp;lt;/i&amp;gt;&#039;&#039;&#039;: The multiples of this value of timestep is when averages are calculated.&lt;br /&gt;
&lt;br /&gt;
Ex: For the values &amp;lt;i&amp;gt;Nevery&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;Nrepeat&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;Nfreq&amp;lt;/i&amp;gt; as 100, 1000 and 100000...&lt;br /&gt;
:*When nearing timestep = 100000&lt;br /&gt;
&lt;br /&gt;
:*100, 200, 300, 400... 5400, 5500, 5600 ... 99700, 99800, 99900, 100000&lt;br /&gt;
:*These numbers are 100 timesteps apart from each other. They are the previous 1000 repeats of this timestep which preceded the timestep 100000 when an average is calculated.&lt;br /&gt;
&lt;br /&gt;
This repeats again from 100100 to 200000 where another average of a different set of 1000 values will be calculated.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This then means that in this simulation the values such as temperature will be sampled every 100 timesteps. While for the duration of the 100000 timestep simulation, 1000 measurements will contribute to the average.&lt;br /&gt;
&lt;br /&gt;
Finally the total time that is simulated is: number of steps multiplied by the chosen timestep for the simulation.&amp;lt;br&amp;gt;&amp;lt;math&amp;gt;100000 \times 0.0025 = 250&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
Figure 14 is a plot of density against reduced pressure. As temperature increases, density of the system decreases which in turn suggested that the volume increased when the system increased in energy.&lt;br /&gt;
&lt;br /&gt;
[[File:NpT with errorbars.PNG|thumb|none|700px|&#039;&#039;&#039;Figure 14: &#039;&#039;&#039; A plot of Density against Reduced Temperature.]]&lt;br /&gt;
&lt;br /&gt;
Figure 15 is the same plot with additional lines showing the change in density of ideal gases with different pressures when temperature changes.&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density of an ideal gas, suggesting that in an ideal gas the same number of molecules can occupy less space.&lt;br /&gt;
&lt;br /&gt;
This can be explained as ideal gases assume that there are no interactions between particles. This leads to repulsive forces being non-existent in an ideal gas, allowing particles to be closer to each other.&lt;br /&gt;
&lt;br /&gt;
The simulated systems assume Lennard Jones potentials and when particles become too close to each other, the potential energy increases and they will be pushed apart to occupy a higher volume and lower density.&lt;br /&gt;
&lt;br /&gt;
This discrepancy increases with increased pressure as the difference in densities is larger for the system with a pressure of 3.0 than 2.5.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the discrepancy increase with pressure and decrease with temperature?  When is the ideal gas approximation best?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:NpT with ideal gas.PNG|thumb|none|700px|&#039;&#039;&#039;Figure 15: &#039;&#039;&#039; A Density-Temperature Plot with the predicted densities of an ideal gas at the same pressures.]]&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities Using Statistical Physics ==&lt;br /&gt;
&lt;br /&gt;
In this section a NVT ensemble was simulated to calculate the heat capacity.&lt;br /&gt;
&lt;br /&gt;
Figure 16 shows a plot of heat capacity at a constant volume over volume. It is showing the variation in energy as temperature changes.&lt;br /&gt;
&lt;br /&gt;
[[File:NVT Heat Capacity Volume Temperature.PNG|thumb|none|600px|&#039;&#039;&#039;Figure 16: &#039;&#039;&#039;Plot of &amp;lt;big&amp;gt;&amp;lt;sup&amp;gt;C&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;&amp;lt;/sup&amp;gt;/&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt;&amp;lt;/big&amp;gt; against reduced temperature for two different densities.]]&lt;br /&gt;
&lt;br /&gt;
The trend shown is expected. As by increasing the energy of a system by increasing temperature, the systems total capacity for heat decreases. Higher densities allow higher heat capacity/volume because there is a lower volume and hence a higher value of heat capacity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you add a bit more detail to this explanation?  Why do you expect the heat capacity to decrease with temperature?  The heat capacity is higher at higher densities because there are more particles per unit volume and hence more energy is required to raise the temperature.  What function have you used to fit the heat capacity data to and why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### SET DENSITY OF LATTICE ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp atoms vol&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp v_temp2&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable ave_energy equal f_aves[1]&lt;br /&gt;
variable ave_energy2 equal f_aves[2]&lt;br /&gt;
variable ave_temp equal f_aves[3]&lt;br /&gt;
variable ave_temp2 equal f_aves[4]&lt;br /&gt;
variable cv equal ${n2}*(${ave_energy2}-${ave_energy}*${ave_energy})/(${ave_temp}*${ave_temp})&lt;br /&gt;
variable cv_v equal ${cv}/${vol}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print “Variables&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${ave_temp}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv: ${cv}&amp;quot;&lt;br /&gt;
print &amp;quot;Cv/V : ${cv_v}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
&lt;br /&gt;
Simulations of Lennard-Jones potentials for the three different phases solid, liquid and a gas were performed. The &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt; were plotted against distance and are shown in Figure 17 and 18.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Rdf gr slg.PNG|thumb|570px|&#039;&#039;&#039;Figure 17: &#039;&#039;&#039;RDF of a solid, liquid and gas.]]&lt;br /&gt;
|[[File:Rdf int(gr) sgl.PNG|thumb|540px|&#039;&#039;&#039;Figure 18: &#039;&#039;&#039;RDF of a solid, liquid and gas.]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
The radial distribution function, g(r) shows the probability of finding another atom as a function of distance from a reference atom. In particular the probability of finding a particle on the surface of a sphere as the radius increases.&lt;br /&gt;
&lt;br /&gt;
In all three systems, the RDF initially shows a value of zero before a sharp increase just before r=1. The RDF is zero here because the region is the van der Waals radii of the reference particle. If the probability of finding other particles in this range was larger than 0 then the potential energy of the system would dramatically increase and become very unfavoured because of strong repulsive forces.&lt;br /&gt;
&lt;br /&gt;
In a gas, the probability of finding other particles quickly averages out as the particles in a gas can easily diffuse. So the probability of find more gas particles quickly becomes the same throughout the system. This is very similar to a liquid, though there is a slight increase in organisation of particles immediately surrounding the reference particle.&lt;br /&gt;
&lt;br /&gt;
In solids the RDF shows discrete peaks as you increase the distance from the reference particle. This shows that the structure of a solid is very organised and a particular unit cell of atoms can be repeated periodically in three dimensions of a lattice.&lt;br /&gt;
&lt;br /&gt;
The first three peaks in the RDF for a solid correspond to the first three nearest neighbours in the lattice. This is shown in Figure 19 where some of the nearest neighbour relationships are labelled.&lt;br /&gt;
[[File:Solid fcc neighbours.png|thumb|none|500px|&#039;&#039;&#039;Figure 19: &#039;&#039;&#039; FCC lattice, showing the 1st, 2nd and 3rd nearest neighbours.]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing in the solid system is the distance between the reference atom and the 2nd nearest neighbour.&amp;lt;br&amp;gt;For a simulation where the density of the system is 1.5 with a temperature of 1.2: the lattice spacing &#039;&#039;&#039;a&#039;&#039;&#039; is 1.375.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the first three peaks are:&lt;br /&gt;
&lt;br /&gt;
*12 for the first peak and the first nearest neighbour.&lt;br /&gt;
*6 for the second peak and the second nearest neighbour.&lt;br /&gt;
*24 for the third peak and the third nearest neighbour.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The RDF shows that liquids have short ranged order, but solids have long range order.  How did you get the coordination numbers for the first 3 peaks?  How does the value of the lattice parameter calculated from the RDF compare with the value of the lattice that you set up initially in your simulation?  You could have calculated the lattice parameter from the first and third peaks as well using the geometry of the fcc lattice and then taken an average.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
The mean squared displacement is a measure of the deviation time between the position of a particle and some reference position.&lt;br /&gt;
&lt;br /&gt;
Figure 20 shows a plot of the &#039;&#039;&#039;total mean squared displacement against timestep&#039;&#039;&#039; for the three different phases: a vapour phase, a liquid phase and a solid phase.&amp;lt;br&amp;gt;&lt;br /&gt;
It can be seen that displacement occurs significantly faster for the vapour phase than the liquid or solid phases.&lt;br /&gt;
&lt;br /&gt;
Since the mean squared displacement by time, &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt; has already been plotted. The diffusion coefficient can be estimated by extrapolating the linear regions of each line and dividing through by 6 because: &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;
The values of D are shown in Table 2 below. As expected a vapour phase has the largest diffusion coefficient and is significantly large than the diffusion coefficients for liquid and solid phases.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Total MSD slg.PNG|thumb|none|570px|&#039;&#039;&#039;Figure 20: &#039;&#039;&#039;A plot of total mean squared displacement against timestep]]||[[File:Million MSD slg.PNG|thumb|none|645px|&#039;&#039;&#039;Figure 21: &#039;&#039;&#039; A plot of total mean squared displacement against timestep for a simulation of one million atoms.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|class=&#039;wikitable&#039;&lt;br /&gt;
|+ Table 2 - Values of D for the two simulations of mean squared displacement against time&lt;br /&gt;
!Phase&lt;br /&gt;
!D (Area/time) - MSD&lt;br /&gt;
!D (Area/time) - MSD (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!Vapour&lt;br /&gt;
|6.05&lt;br /&gt;
|3.18&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|8.49 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|8.72 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Solid&lt;br /&gt;
|7.20 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt;&lt;br /&gt;
|4.39 x 10&amp;lt;sup&amp;gt;-6&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plot the MSDs for different phases on different graphs as it is difficult to see the shape of the solid and liquid MSD from your plots.  Why is the gas MSD curved initially (ballistic regime) before becoming linear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The Velocity Autocorrelation Function is:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
A 1D harmonic oscillator:&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;
:&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = -A\omega \sin\left(\omega t + \phi\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute into the equation for a normalised velocity autocorrelation function: &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;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \left(-A\omega \sin\left(\omega t + \phi\right)\right)\times\left(-A\omega \sin\left(\omega (t+\tau) + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega \sin\left(\omega t + \phi\right))^2\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} A\omega \sin\left(\omega t + \phi\right)\times 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;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{A^2\omega^2  \int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\times \sin\left(\omega t+\omega \tau + \phi\right)\ \mathrm{d}t}{A^2\omega^2 \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;C\left(\tau\right) = \frac{ \int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right)\times \sin\left(\omega t+\omega \tau + \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;
&lt;br /&gt;
Using double angle formula: &amp;lt;math&amp;gt;\sin(\alpha \pm \beta) = \sin \alpha \cos \beta \pm \cos \alpha \sin \beta &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin(\omega t+ \phi + \omega\tau  ) = \sin (\omega t+\phi) \cos \omega \tau + \cos (\omega t +\phi)\sin \omega\tau&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}  \sin\left(\omega t + \phi\right) \times[\sin (\omega t+\phi) \cos \omega \tau + \cos (\omega t +\phi)\sin \omega\tau]\ \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;C\left(\tau\right) = \frac{ \int_{-\infty}^{\infty}  \sin^2\left(\omega t + \phi\right) \cos \omega \tau + \sin\left(\omega t + \phi\right)\cos (\omega t +\phi)\sin \omega\tau\ \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;
The constants &amp;lt;math&amp;gt;\cos\omega\tau&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\omega\tau&amp;lt;/math&amp;gt; can be moved to the front.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\cos \omega \tau  \int_{-\infty}^{\infty}  \sin^2 \left(\omega t + \phi \right) \mathrm{d}t + \sin \omega\tau \int_{-\infty}^{\infty}  \sin\left(\omega t + \phi\right)\cos (\omega t +\phi)\ \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;C\left(\tau\right) = \frac{\cos \omega \tau  \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} + \frac{\sin \omega\tau \int_{-\infty}^{\infty}  \sin\left(\omega t + \phi\right)\cos (\omega t +\phi)\ \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;C\left(\tau\right) = \cos\omega\tau + \frac{\sin \omega\tau \int_{-\infty}^{\infty}  \sin\left(\omega t + \phi\right)\cos (\omega t +\phi)\ \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;
From here, evaluate the integrals as odd and even functions.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;sin(x)cos(x)&amp;lt;/math&amp;gt; is an odd function, and integrating an odd function between equal limits = 0.&amp;lt;br&amp;gt;The numerator on the right hand side becomes &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \sin \omega\tau \int_{-\infty}^{\infty}  \sin\left(\omega t + \phi\right)\cos (\omega t +\phi)\ \mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \cos\omega\tau + 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \cos\omega\tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, clear derivation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
==== Plotting the VACF for different simulations ====&lt;br /&gt;
Figure 22, shows a plot of the VACF for a liquid and a solid and a harmonic oscillator. If there was no interactions in the system, the atoms would retain their velocities and the plot would show a graph with a horizontal line. However the presence of attractive and repulsive forces between atoms cause them to loose their initial energy and initial velocity.&lt;br /&gt;
&lt;br /&gt;
The minima of the VACFs for the liquid and solid represent the maximum velocities of the atoms when they are travelling in opposite directions to their initial velocities.&lt;br /&gt;
&lt;br /&gt;
The VACF for the liquid has an initial higher velocity because it is at a higher energy system than the solid. However it looses this velocity more rapidly than the solid because of the increased probability in collisions in a more diffusive system. Whereas in the solid, the velocities can much more easily pass back and forth between atoms because how orderly the atoms are arranged in a solid. This leads to a longer period of time where there is a significant oscillation in the velocity of the solid before averaging out like the liquid.&lt;br /&gt;
&lt;br /&gt;
The difference in the VACF for the harmonic oscillator is mainly due to the fact that a harmonic oscillator observes the conservation of energy during an oscillation. This results in a wave where the maxima and minima of the curve have equal amplitudes. In the Lennard Jones liquid and solid, there are atomic interactions that will interfere with this energy conservation and the velocity averages out.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF approx.PNG|thumb|none|550px|&#039;&#039;&#039;Figure 22: &#039;&#039;&#039;Plot of &amp;lt;math&amp;gt;cos(\omega\tau)&amp;lt;/math&amp;gt;, and the VACF for a Lennard Jones liquid and a solid.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The decorrelation of the VACF is not because of lack of conservation of energy, but is caused by collisions between particles which randomise the velocities of the particles.  There are no collisions in the harmonic oscillator.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Estimating D from VACF ===&lt;br /&gt;
&lt;br /&gt;
As the diffusion coefficient can also be estimated by this equation: &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be seen that value is one third of the previously calculated integral for the Velocity Autocorrelation Function.&lt;br /&gt;
&lt;br /&gt;
Figures 23-26 are the running integrals of the VACF for the three phases, calculated with the trapezium rule. &lt;br /&gt;
{|&lt;br /&gt;
|[[File:Integral slg.png|thumb|500px|&#039;&#039;&#039;Figure 23: &#039;&#039;&#039;Integration of the VACF for a vapour, liquid and solid.]]&lt;br /&gt;
|[[File:Integral sl.png|thumb|500px|&#039;&#039;&#039;Figure 24: &#039;&#039;&#039;Integration of the VACF for a liquid and solid.]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Integral slg million.png|thumb|500px|&#039;&#039;&#039;Figure 25: &#039;&#039;&#039;Integration of 1 million atoms of the VACF for a vapour, liquid and solid.]]&lt;br /&gt;
|[[File:Integral sl million.png|thumb|500px|&#039;&#039;&#039;Figure 26: &#039;&#039;&#039;Integration of 1 million atoms of the VACF for a liquid and solid.]]&lt;br /&gt;
|}&lt;br /&gt;
The final value of the integral for the vapour, liquid and solid shown in Figures 23-26 divided by three is a good estimate for the diffusion coefficient.&lt;br /&gt;
&lt;br /&gt;
Table 3 shows the diffusion coefficients calculated from the VACF.&lt;br /&gt;
&lt;br /&gt;
{|class=&#039;wikitable&#039;&lt;br /&gt;
|+Table 3 - Values of D for the two simulations of VACF&lt;br /&gt;
!Phase	!!D (Area/time) - VACF	!!D (Area/time) - VACF (million atoms)&lt;br /&gt;
|-&lt;br /&gt;
!Vapour&lt;br /&gt;
|6.34||3.27&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|8.49 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;||9.01 x 10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Solid&lt;br /&gt;
|1.14 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;||4.55 x 10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you compare these values of the diffusion coefficients calculated from a VACF to the values of diffusion coefficients calculated from the mean squared displacement, you can see that the values agree with each other rather well. The values of D also are expected, as the diffusion coefficient is largest for the vapour phase and lowest for the solid phase. As diffusion is easiest in a gas and much harder in a rigid solid structure.&lt;br /&gt;
&lt;br /&gt;
The largest error for the estimates of D is probably from the estimation of the integral. The trapezium method tends to overestimate in its calculation of the area under the curve and so the values of the diffusion coefficient using the VACF are larger than the values of D calculated from the MSD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: To calculate the diffusion coefficient from the integral of the VACF we replace the upper limit of the integral by the length of the simulation and this is only valid if the integral has converged by this time, which may be another source of error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MDSOSLjv1214&amp;diff=602789</id>
		<title>Talk:Mod:MDSOSLjv1214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MDSOSLjv1214&amp;diff=602789"/>
		<updated>2017-03-16T06:31:26Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Great report with well thought out written answers showing a good understanding of the material.  Try to make the layout clear...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Great report with well thought out written answers showing a good understanding of the material.  Try to make the layout clearer so that it is easier to see where you have answered each question and show your working for calculations.  Also try to write a bit more concisely so that your arguements are clearer.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Molecular dynamics simulations of simple liquids&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= MISSION 1: Introduction to molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE A:&#039;&#039;&#039; Reconnaissance of errors in the velocity-Verlet algorithm simulation of a classical harmonic oscillator. No room for mistakes! Reduce change in energy below 1%.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT A: &#039;&#039;&#039;A file containing the velocity-Verlet (v-V) algorithm for a classical harmonic oscillator was provided to us at the start of the mission. This algorithm requires initial conditions for the position and the velocity, &#039;&#039;&#039;x(0)&#039;&#039;&#039; and &#039;&#039;&#039;v(0) &#039;&#039;&#039;respectively. The position at time &#039;&#039;&#039;t&#039;&#039;&#039; depends on the position one time step before &#039;&#039;&#039;x(t-dt)&#039;&#039;&#039; and the velocity half a time step before &#039;&#039;&#039;v(t-0.5dt)&#039;&#039;&#039;. With this dependence, it was apparent that errors would tend to accumulate over the course of our simulations. First, we compared the errors in the position &#039;&#039;&#039;x&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;(t) &#039;&#039;&#039;between solution from the v-V algorithm and the classical solution given in our case as &#039;&#039;&#039;x&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(t) = cos(t)&#039;&#039;&#039;. The error was calculated as &#039;&#039;&#039;err(t) =&#039;&#039;&#039; &#039;&#039;&#039;{{!}}x&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;(t)-x&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(t){{!}} &#039;&#039;&#039;and the plot over the course of the simulation is shown in&#039;&#039;&#039; Figure 1&#039;&#039;&#039;.   &lt;br /&gt;
&lt;br /&gt;
Next we aimed to find a function that would help us find the local maxima in the error &#039;&#039;&#039;err(t)&#039;&#039;&#039;. At the maximum, the first derivative of &#039;&#039;&#039;err(t)&#039;&#039;&#039; with respect to &#039;&#039;&#039;t&#039;&#039;&#039; must be zero. Below is showed the function &#039;&#039;&#039;f(t)&#039;&#039;&#039; proposed to help us find the times at which the aforementioned condition is fulfilled.   &lt;br /&gt;
  &lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;{\operatorname{d}\!err(t)\over\operatorname{d}\!t} = {\operatorname{d}\!x_v(t)\over\operatorname{d}\!t} - {\operatorname{d}\!x_c(t)\over\operatorname{d}\!t} = 0 = v_v(t) + sin(t) \text{   } {\Longrightarrow} \text{   } \text{proposed function:}\quad f(t) = t - arcsin({\mid}v_v(t){\mid} ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 2&#039;&#039;&#039; shows in one plot the functions &#039;&#039;&#039;err(t)&#039;&#039;&#039; and &#039;&#039;&#039;f(t)&#039;&#039;&#039;. The start- and end-points of the plateaus in the &#039;&#039;&#039;f(t)&#039;&#039;&#039; correspond well to the maxima in &#039;&#039;&#039;err(t)&#039;&#039;&#039; near the end of the simulation. As we mentioned above, the algorithm accumulates the errors over time, thus near the beginning of the simulation, there is a strong disagreement between the actual positions of the maxima in &#039;&#039;&#039;err(t)&#039;&#039;&#039; and the positions predicted by our function. Once enough errors have accumulated, the maxima in error start to behave more regularly and appear always when the absolute value of velocity &#039;&#039;&#039;v&amp;lt;sub&amp;gt;v&amp;lt;/sub&amp;gt;(t) &#039;&#039;&#039;reaches maximum. The light blue line in &#039;&#039;&#039;Figure 1&#039;&#039;&#039; represents the empirical trend in the values of the local maxima from which the cumulative property of the errors is apparent as the error maxima clearly increase in value linearly with time.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:JV-1214-ERRORS2.png|thumb|650x650px|&#039;&#039;&#039;Figure 1&#039;&#039;&#039; - The change in absolute value of error in position between the v-V algorithm and classical solution for classical harmonic oscillator over the course of the simulation. The linear trend in local maxima of the error is shown.]]&lt;br /&gt;
|[[File:JV-1214-ft.png|thumb|650x650px|&#039;&#039;&#039;Figure 2&#039;&#039;&#039; - Plot showing relation between functions &#039;&#039;&#039;err(t)&#039;&#039;&#039; and &#039;&#039;&#039;f(t)&#039;&#039;&#039;.]]&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
Having examined the error in the position, we then looked at the change of the total energy in our v-V algorithm simulation of classical harmonic oscillator. Monitoring the total energy in simulations of systems and making sure that it does not change significantly throughout the simulation is a good way of making sure that our simulation is not horribly useless. The total energy in the classical harmonic oscillator system is calculated as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; E = \cfrac{1}{2}mv^2 + \cfrac{1}{2}kx^2 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figure 3&#039;&#039;&#039; illustrates the oscillatory behaviour of the total energy in our system with simulation time step 0.1 as a cos(2t): period 1π. The minima in the total energy in the system correspond to points where the displacement &#039;&#039;&#039;x &#039;&#039;&#039; is zero (the displacement follows cos(t): period 2π and reaches zero every π time units). The change in the total energy &#039;&#039;&#039;dE &#039;&#039;&#039;depends on the time step used in the simulations - this relationship is shown in &#039;&#039;&#039;Figure 4&#039;&#039;&#039; where we find &#039;&#039;&#039;dE&#039;&#039;&#039; to roughly increase with second power of &#039;&#039;&#039;dt&#039;&#039;&#039;. The breaking point in &#039;&#039;&#039;dt&#039;&#039;&#039; after which the change in energy surpasses the bearable 1% limit is found to be 0.2.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:JV-1214-energy-fluct.png|thumb|650x650px|&#039;&#039;&#039;Figure 3&#039;&#039;&#039; - The fluctuation in the total energy in the v-V algorithm simulation of classical harmonic oscillator with time step 0.1.]]&lt;br /&gt;
|[[File:JV-1214-energy.png|thumb|&#039;&#039;&#039;Figure 4&#039;&#039;&#039; - The dependence of the total energy fluctuation &#039;&#039;&#039;dE&#039;&#039;&#039; on the time step &#039;&#039;&#039;dt. &#039;&#039;&#039;|481x481px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  Why did you try to fit a function to the error to find the maxima and what do you mean by &amp;quot;the maximum in error starts to behave more regularly&amp;quot;?  Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE B:&#039;&#039;&#039; Acting forces, cubes and reduced units. Unlock your potential!&lt;br /&gt;
[[File:Jv1214-potential.png|thumb|450x450px|&#039;&#039;&#039;Figure 5&#039;&#039;&#039; - Plot of Lenard-Jones potential]]&lt;br /&gt;
&#039;&#039;&#039;REPORT B: &#039;&#039;&#039;We move from a classical harmonic oscillator towards an anharmonic one - i.e. at infinite separation &#039;&#039;&#039;r &#039;&#039;&#039;the interatomic interactions are zero and at smaller than the equilibrium separation &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&#039;&#039;&#039;  the repulsive forces grow faster than in the harmonic oscillator. The anharmonic oscillator is described by the Lennard-Jones potential given as (plot in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \phi(r) = 4\epsilon ( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There exist two interesting separations. The first one &#039;&#039;&#039;r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&#039;&#039;&#039; is a separation at which the potential is zero. By simple arithmetics, &#039;&#039;&#039;r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&#039;&#039;&#039; is found to be &#039;&#039;&#039;r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = σ&#039;&#039;&#039; : sigma is the interatomic separation at which the potential &#039;&#039;&#039;ϕ(r) &#039;&#039;&#039;is zero. The second interesting separation is the equilibrium one &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; &#039;&#039;&#039;at which the attractive and repulsive forces cancel out - at this point the potential is at its minimum (as shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;) and thus &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; &#039;&#039;&#039;can be found by equating the first derivative of &#039;&#039;&#039;ϕ(r) &#039;&#039;&#039;to zero. For a single Lenard-Jones interaction, the first derivative is equal to the total force acting on the particle. We found successfully the separation &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt; &#039;&#039;&#039;(force is zero there)&#039;&#039;&#039; &#039;&#039;&#039;for which we also calculated the potential well depth to be &#039;&#039;&#039;-ε&#039;&#039;&#039; : epsilon is thus the potential minimum on the Lenard-Jones potential plot. At the zero-potential separation &#039;&#039;&#039;r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&#039;&#039;&#039; we calculated the acting force and found it to be a repulsive force which agrees with our hypothesis that when the particles are too close they will repel. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; F_i = {\operatorname{d}\!\phi(r)\over\operatorname{d}\!r} = 4\epsilon (-12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;  \text{   } {\Longrightarrow} \text{   } \text{at equilibrium separation:} \text{   }4\epsilon (-12\frac{\sigma^{12}}{r^{13}} + 6\frac{\sigma^6}{r^7} ) = 0 \text{   } {\Longrightarrow} \text{   } r = 2^{1/6}\sigma \text{   } {\Longrightarrow} \text{   } \phi(r) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;  \text{   } {\Longrightarrow} \text{   } \text{at zero-potential separation:} \text{   } r = \sigma \text{   } {\Longrightarrow} \text{   } F_i = -24\frac{\epsilon}{\sigma} \text{   } {\Longrightarrow} \text{   } \text{repulsive force}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, we only considered the interactions between two particles. However, we want to model a liquid system probably with more than two particles. In such case, the potential energy of one particle is then the sum of all the interactions with the remaining particles - but to model such a system a lot of computational power is required. For example, if we wanted to model 1 mL of water which contains &#039;&#039;&#039;3.35*10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&#039;&#039;&#039; &#039;&#039;&#039;particles&#039;&#039;&#039;, we would then need to calculate that many interactions for every particle in the system. We instead try to simplify the system to save the power. We can limit ourselves to a smaller volumes and thus smaller numbers of particles - e.g. 10000 water particles under standard conditions occupy volume of &#039;&#039;&#039;2.99*10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL&#039;&#039;&#039; - corresponding to a cube with a edge length of 669 nm. Or, fortunately, the strength of the interatomic interactions decays strongly with distance. Thus, it is reasonable to disregard any interactions with particles that are further than certain separation limit. To find this limiting separation, we evaluate the integrals of the potential from &#039;&#039;&#039;2σ&#039;&#039;&#039;, &#039;&#039;&#039;2.5σ&#039;&#039;&#039; and &#039;&#039;&#039;3σ&#039;&#039;&#039; to infinity and compare them to the integral from &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&#039;&#039;&#039; to infinity. The obtained values are shown in &#039;&#039;&#039;Table 1&#039;&#039;&#039;. We see that at the &#039;&#039;&#039;3σ&#039;&#039;&#039; separation the value of the integral is less than 1% of the integral value at the equilibrium separation and thus it seems reasonable to only consider the interactions with particles within this separation.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&#039;&#039;&#039;Table 1&#039;&#039;&#039; - Results of the integration of ϕ(r) from a starting separation to infinity with respect to r with ε=σ=1&lt;br /&gt;
!Starting separation&lt;br /&gt;
!Integral value&lt;br /&gt;
|-&lt;br /&gt;
|r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-0.3469&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|2σ&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-0.0258&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|2.5σ&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-0.0082&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|3σ&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;-0.0033&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
Life (i.e. simulations of liquids) can be further simplified by introducing boundary conditions and using reduced units. With the boundary conditions, we simulate a cube containing particles and we make sure that the number of particles in the cube remains constant by making sure that if a particle leaves the cube through one face, it immediately reenters the cube from the opposite face. For instance, if we have an atom at position (0.5, 0.5, 0.5) in a cubic box running from (0, 0, 0) to (1, 1, 1) and this atom moves along the (0.7, 0.6, 0.2) vector, instead of ending up at position (1.2, 1.1, 0.7) which is outside the box it will end up at position &#039;&#039;&#039;(0.2, 0.1, 0.7)&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
With regard to the reduced units, if we consider a Lenard-Jones potential for argon with σ=0.34 nm and ε/k&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt;=120 K, instead of writing writing the cutoff separation as &#039;&#039;&#039;1.088 nm&#039;&#039;&#039; we can instead express it in the reduced units as 3.2, or instead of writing temperature as &#039;&#039;&#039;180 K&#039;&#039;&#039; we can express it in the reduced units as 1.5, and instead of writing the potential well depth as &#039;&#039;&#039;0.997 kJ*mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039; we can express it in the reduced units as simply 1.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct, but show your working and would be clearer not to include your answers in a paragraph of text.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 1:&#039;&#039;&#039; Two different approaches to introduction to liquid simulations: [https://wiki.ch.ic.ac.uk/wiki/images/c/cd/Dog-1097662_1920.jpg theory-first] vs [https://upload.wikimedia.org/wikipedia/commons/5/50/Golden_Retriever_charge.jpg experiment-first].&lt;br /&gt;
&lt;br /&gt;
= MISSION 2: Equilibration =&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE A:&#039;&#039;&#039; Understand the input script!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT A: &#039;&#039;&#039;At the beginning of the simulation we arrange the particles of the modelled liquid into a highly ordered crystalline arrangement (e.g. simple cubic) - this, of course, does not correspond to the more disordered state of molecules in a real liquid but the simulation moves quickly towards more reasonable arrangement (example of &#039;how fast&#039; discussed later below). We use this starting arrangement instead of a random initial arrangement to avoid problems that could arise from generating some particles too close together - as we saw previously with the Lenard-Jones potential the repulsive forces rise rapidly with decreasing separation (once below &#039;&#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;&#039;&#039;&#039;) and since these forces affect the velocities of our particles and since &#039;&#039;&#039;we use the velocity-Verlet algorithm &#039;&#039;&#039;(we specify initial position and initial velocity of each of the simulated particles) which bases the calculation of velocities and positions on the velocities in the previous time-steps - these unnaturally high repulsive forces at the beginning of the simulation would cause our simulation to diverge (example shown later) unless we would choose really small time step which is much more computationally demanding than to start from the ordered arrangement.&lt;br /&gt;
&lt;br /&gt;
In our first simulations we use simple cubic lattice as the starting point with a number density 0.8. The density multiplied by the volume of the unit cell must equal 1 for sc lattice - one lattice point per unit cell. In a face-centred cubic lattice there are 4 lattice points per unit cell. The side-lengths of a cubic cell for a sc lattice with density 0.8 and fcc lattice with density 1.2 follow (n = number of lattice points per unit cell, a = side length of a unit cell, ρ = number density) ρ*a&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;=n and are equal to &#039;&#039;&#039;1.07722&#039;&#039;&#039; and &#039;&#039;&#039;1.49380&#039;&#039;&#039;, respectively.&lt;br /&gt;
&lt;br /&gt;
Once we have chosen the lattice type and specified the number density, we can then create a box containing e.g. 10x10x10=1000 unit cells - such box will contain 1000 atoms for sc and &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; for fcc.&lt;br /&gt;
&lt;br /&gt;
At the beginning of each input script, we usually define any quantities (which we could consider changing later) as variables and use the variable down the script instead of using the hard number - this allows us to change all mentions of time-step in the script from 0.001 to 0.002 at once rather than having to go through the whole script and changing it several times.&lt;br /&gt;
&lt;br /&gt;
Some important commands to consider:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; - sets the mass for atoms of type 1 to be 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; - specifies that we use cutoff Lennard-Jones potential with no Coulomb as the pair potential used by LAMMPS with cutoff separation of 3 in reduced units.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039; - sets the coefficients sigma and epsilon in the L-J potential to be equal to 1.0 for all (*) atom types.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&amp;lt;nowiki/&amp;gt;OBJECTIVE B: &#039;&#039;&#039;Choose wisely the time-step! You should not rush but don&#039;t be late either.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT B: &#039;&#039;&#039;We use our input script to create a box with the simulated particles which have well defined initial position. The script also assigns particles random initial velocities in such a way that the mean square velocity remains constant and equal to value based on the fixed initial conditions. Every particle thus has well-defined &#039;&#039;&#039;x(0)&#039;&#039;&#039; and &#039;&#039;&#039;v(0)&#039;&#039;&#039; and the v-V algorithm can be applied on the system. Our script records the total energy, temperature and pressure throughout the simulation, and plots of these quantities for the simulation with time-step = 0.001 are shown in &#039;&#039;&#039;Figures 6-8&#039;&#039;&#039;, respectively. As we predicted above, with this relatively short time-step, the system equilibrates quickly from the high-energy initial state to the ground state within &#039;&#039;&#039;t = 0.5&#039;&#039;&#039;. The equilibration is observed in all 3 quantities, and once the equilibrium is reached these quantities continue to fluctuate around the equilibrium values within reasonably small range. &lt;br /&gt;
&lt;br /&gt;
The simulation with the time-step 0.001 equilibrates successfully, but ideally we would like to obtain the same result with longer time-step, i.e. running less simulation points for a given time length of the simulation. A comparison in changes of total energy throughout 5 simulations with different time steps is shown in &#039;&#039;&#039;Figure 9&#039;&#039;&#039;. The simulation with the longest time-step = &#039;&#039;&#039;0.015&#039;&#039;&#039; is the only one that does not converge - it diverges because the time-step is too long to react accurately to the changes in the measured quantities and as we mentioned above the v-V algorithm tends to accumulate errors throughout the simulation, thus with the too long time-step during the most turbulent time in our simulation (i.e. the beginning) a significant error is accumulated within the first few steps and this makes it impossible for the simulation to converge to the correct values. &lt;br /&gt;
&lt;br /&gt;
With the shorter time-steps 0.01 and 0.0075 we see that the simulation converges but not at the correct value obtained with time-step 0.001. This is again the result of the errors accumulated within the few initial steps of the simulation. Finally, the simulation with &#039;&#039;&#039;dt = 0.0025 &#039;&#039;&#039;not only converges but even converges to the same (i.e. well within acceptable limits) equilibrium value as the simulation with the shortest &#039;&#039;&#039;dt&#039;&#039;&#039;. Therefore, &#039;&#039;&#039;dt = 0.0025&#039;&#039;&#039; is the optimal time-step for our simulation (from the 5 tested ones) and chosen to be used in the subsequent simulations. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:JV1214-energ.png|thumb|650x650px|&#039;&#039;&#039;Figure 6&#039;&#039;&#039; - Change in Total Energy throughout the simulation with time-step = 0.001.]]&lt;br /&gt;
|[[File:JV1214-temp.png|thumb|650x650px|&#039;&#039;&#039;Figure 7&#039;&#039;&#039; - Change in Temperature throughout the simulation with time-step = 0.001.]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:JV1214-pres.png|thumb|650x650px|&#039;&#039;&#039;Figure 8&#039;&#039;&#039; - Change in Pressure throughout the simulation with time-step = 0.001.]]&lt;br /&gt;
|[[File:JV-1214-intro5.png|thumb|650x650px|&#039;&#039;&#039;Figure 9&#039;&#039;&#039; - Comparison of changes in Total Energy throughout simulations with different time-steps.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 2:&#039;&#039;&#039; Example of [https://wiki.ch.ic.ac.uk/wiki/images/8/8c/Jv1214-reverse.gif a liquid system with diverging total energy].&lt;br /&gt;
&lt;br /&gt;
= MISSION 3: Running simulations under specific conditions =&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE: &#039;&#039;&#039;Find your balance! There is no pressure but try to run simulations at specified temperatures and pressures. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT : &#039;&#039;&#039;Previous simulations were run in the microcanonical ensemble. We now move towards the canonical ensemble for which we specify in our script the temperature and pressure at which we want our simulation to be conducted. This more closely corresponds to a laboratory situation where we e.g. work at atmospheric pressure and control/keep fixed the reaction temperature.&lt;br /&gt;
&lt;br /&gt;
Over the course of the simulation, the simulation has to try to keep the system temperature (and pressure) around the initially specified target. To do so, the simulation uses the equipartition theorem for the kinetic energy of the particles in our system which follows (as we have 3 degrees of translational freedom):&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;math&amp;gt; E_k = \frac{1}{2}\sum_{i}^{} m_iv_i^{2} = \frac{3}{2}Nk_BT (1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the target temperature is &#039;&#039;&#039;T&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt;&#039;&#039;&#039; then the actual temperature at a given point in the simulation &#039;&#039;&#039;T&#039;&#039;&#039; can be either lower or higher, thus to get closer to the target temperature the simulation introduces a constant factor &#039;&#039;&#039;γ&#039;&#039;&#039; by which it multiplies the velocity of every particle, the &#039;&#039;&#039;γ&#039;&#039;&#039; for every step is determined as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \frac{1}{2}\sum_{i}^{} m_i({\gamma}v_i)^{2} = \frac{3}{2}Nk_BT_t \text{   } {\Longrightarrow} \text{   } \text{(gamma independent of i)} {\Longrightarrow} \text{   } \frac{1}{2}{\gamma}^{2}\sum_{i}^{} m_iv_i^{2} = \frac{3}{2}Nk_BT_t&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  {\Longrightarrow} \text{   } \text{(substitute from equation (1))} {\Longrightarrow} \text{   } {\gamma}^{2}\frac{3}{2}Nk_BT = \frac{3}{2}Nk_BT_t \text{   } {\Longrightarrow} \text{   } {\gamma}^{2}=\frac{T_t}{T}\text{   } {\Longrightarrow} \text{   } \gamma=\sqrt{\frac{T_t}{T}}&amp;lt;/math&amp;gt;[[File:JV1214-runni.png|thumb|650x650px|&#039;&#039;&#039;Figure 10&#039;&#039;&#039; - Change in density with temperature at constant pressure. Comparison between the simulation and ideal gas behaviour.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The simulation takes the square root of the ratio between the target temperature and temperature at a given step and uses this factor on the subsequent step. We can record the average temperature in our system by introducing the command: &#039;&#039;&#039;fix aves all ave/time 100 1000 100000 v_temp&#039;&#039;&#039; which says to record temperature once every &#039;&#039;&#039;100&#039;&#039;&#039; time-steps, to calculate the average out of &#039;&#039;&#039;1000&#039;&#039;&#039; inputs and to calculate the averages every 100000 time-steps. Thus if we run 100000 time-steps the average temperature will be recorded once at the end of our simulation from 1000 temperatures recorded every 100 time-steps.&lt;br /&gt;
&lt;br /&gt;
In this section, we use the script to record the average temperature, pressure, and density (and the corresponding errors for each of them) in simulations of 10 systems (5 dif. temperatures and 2 pressures). We compare the change in density with respect to temperature between the two pressures and between the behaviour expected for an ideal gas at these pressures. The plot of this dependence is shown in Figure 10 - the error bars representing the errors in both temperature and density are included and even though the errors in temperature start to become more apparent as the temperature increases, the errors in density remain negligible. Several observations can be obtained from &#039;&#039;&#039;Figure 10&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Firstly, at a given temperature, the fluid with higher pressure has higher density and these densities decay with increasing temperature when keeping the pressure constant. This is exactly what we should observe. &lt;br /&gt;
&lt;br /&gt;
Secondly, we compare the simulated data for the fluid at 2 different pressures with the behaviour of an ideal gas in reduced units governed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho=\frac{N}{V}=\frac{p}{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At low temperatures, where the fluid is the most dense for a given pressure, we observe strong disagreement between the ideal gas and our simulated fluid. The density of the ideal gas is much higher and the discrepancy is stronger at the higher pressure. This is again exactly as we would expect. The ideal gas approximation assumes that there are no interactions between the particles apart from the perfectly elastic collisions, i.e. instead of having potential curve as the Lenard-Jones one (&#039;&#039;&#039;Mission 1 - Figure 5&#039;&#039;&#039;) we instead have hard spheres between which the potential remains zero going from infinite separation and then the potential shoots up to infinity once the spheres touch - this means that in ideal gas the particles do not repel each other and thus at a given temperature the ideal gas must be more dense in order to achieve the same pressure as a non-ideal fluid at the same temperature. The discrepancy is strongest at the lowest temperature and the higher pressure since under those conditions the particles in the non-ideal system are forced to interact with each other the most. &lt;br /&gt;
&lt;br /&gt;
Lastly, as the temperature increases, in order to keep the pressure constant the density has to decrease, and as the density decreases - the average interatomic distances increase and the particles interact less which leads to a more ideal behaviour of the non-ideal system and to a better agreement between the simulation and the ideal gas. &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The particles in the ideal gas are not hard spheres - they have no volume and no interactions, otherwise the explanation is correct.  Don&#039;t plot straight lines between the data points for the ideal gas as this is a bit misleading since we know that the ideal gas law doesn&#039;t follow this line.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 3&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 3: &#039;&#039;&#039;You have reached middle of this project. If you are marking it while sitting down, reward your future self by standing up and stretching a bit.&lt;br /&gt;
&lt;br /&gt;
= MISSION 4: Calculating heat capacities using statistical physics =&lt;br /&gt;
[[File:JV-1214-heat.png|thumb|650x650px|&#039;&#039;&#039;Figure 11&#039;&#039;&#039; - Change in heat capacity over volume with temperature for systems with fixed density. ]]&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE: &#039;&#039;&#039;Do finally something sort of on your own! Write a script to study heat capacity of a simulated system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT : &#039;&#039;&#039;In this section, we made a script that calculates variance in energy and uses this to calculate heat capacity based on an equation that was provided to us. Our script works in NVT ensemble and we record C&amp;lt;sub&amp;gt;V&amp;lt;/sub&amp;gt; at 5 different temperatures for 2 systems with fixed density at 0.2 and 0.8 respectively. The results are shown in &#039;&#039;&#039;Figure 11&#039;&#039;&#039;. According to the phase diagram for Lennard-Jones system&amp;lt;ref&amp;gt;Hansen, Jean-Pierre P., and Loup Verlet. &amp;quot;Phase Transitions of the Lennard-Jones System.&amp;quot; &#039;&#039;Physical Review&#039;&#039; 184, no. 1 (1969): 151-61.&amp;lt;/ref&amp;gt;, at these densities and pressures we are dealing with a super-critical fluid. There are two observations to be noted. &lt;br /&gt;
&lt;br /&gt;
Firstly, the heat capacity over volume is lower for the system with lower density (unit cell volume = 5.000). This is exactly what we expect from the eqquipartition theorem which states that the heat capacity of a group of particles is directly proportional to the degrees of freedom and to the number of particles ( for 3 degrees of freedom and N particles: &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; C_V = \frac{3}{2}k_BN &amp;lt;/math&amp;gt;). Thus, if we are comparing heat capacities between two equal volumes (i.e. alternative way of saying heat capacity over volume) it is clear that the system with higher density (unit cell volume = 1.250) and therefore with higher number of particles in a given volume must have higher heat capacity. &lt;br /&gt;
&lt;br /&gt;
The second observed trend is the decrease in heat capacity with temperature. From our five data point, it appears to decrease linearly but that is not an expected behaviour (some form of exponential decay would be expected) and is probably just result of small number of data points within small range of temperature values. Regardless of the actual shape of the trend, the trend itself is what is interesting - i.e. the decrease in heat capacity with temperature. We saw an example of decrease in heat capacity during our Statistical Thermodynamics lectures. If we have a two level system, at low temperatures most particles are in the ground state and thus the system has high ability to accommodate additional energy. However, as temperature goes to infinity the two energy levels become almost equally populated and thus to follow Boltzmann distribution - it becomes increasingly harder to excite a particle from the ground state and therefore heat capacity decreases. If we now return to our system, the particles in our system accommodate energy by increasing their kinetic energy and thus their velocity.   &lt;br /&gt;
&lt;br /&gt;
Thus, the heat capacity depends on the ability of our particles to accommodate increase in velocity. Now the initial constraint of our system comes into play, i.e. the fact that the density is fixed. With increase in velocity, in order to keep density constant, we have to increase the pressure. As we increase the velocity, the collisions become more frequent and the relative volume occupied by our particles increases and the interatomic volume decreases - with increasing temperature the system becomes more restrained as the pressure increases and the space where a single particle can move decreases - it becomes increasingly more difficult to keep the density constant as the temperature increases. From this hypothesis, we would expect for the heat capacity to decrease with steeper slope for the system with higher density - and that is exactly what we observe the heat capacity per volume decreases in the higher-density system with &#039;&#039;&#039;slope = -0.047&#039;&#039;&#039; and with &#039;&#039;&#039;slope = -0.039&#039;&#039;&#039; in the lower-density system. There are certainly other competing factors affecting the heat capacity in our case, but based on agreement between the proposed hypothesis and the observed behavior it seem that the decrease in the relative freedom of the system with temperature is the deciding factor.   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestion.  Both the kinetic and potential energy of the particles in the simulation increases when energy is put into the system and remember that these simulations are classical so there are no discrete energy levels.  More frequent collisions do not increase the volume occupied by each particle.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An example of an input script used to record the heat capacities is shown below:   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
&lt;br /&gt;
variable T equal 2.2&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY ENSEMBLE ###&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RECORD TRAJECTORY ###&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
unfix nvt&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; MEASURE SYSTEM STATE ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
&lt;br /&gt;
variable Natm2 equal atoms*atoms&lt;br /&gt;
&lt;br /&gt;
variable energ equal etotal&lt;br /&gt;
&lt;br /&gt;
variable energ2 equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_energ v_energ2&lt;br /&gt;
&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
&lt;br /&gt;
variable varenerg equal (f_aves[3]-f_aves[2]*f_aves[2])&lt;br /&gt;
&lt;br /&gt;
variable heatcap equal ${Natm2}*${varenerg}/${temp2}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;            &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 4&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 4: &#039;&#039;&#039;There is no reward 4 but you are allowed to return to one of the Rewards 1-3.&lt;br /&gt;
&lt;br /&gt;
= MISSION 5: Structural properties and the radial distribution function =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE: &#039;&#039;&#039;Interatomic Affairs. If you can predict quite well atom arrangement even far away from the capital atom, that is a solid result.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT : &#039;&#039;&#039;In this section we look at the Radial Distribution Function (RDF) of a solid, liquid and gas phases in Lennard-Jones system. The RDF &#039;&#039;&#039;g(r)&#039;&#039;&#039; represents the probability of finding an atoms at a given distance &#039;&#039;&#039;r&#039;&#039;&#039; from the central atom. By integrating &#039;&#039;&#039;g(r) &#039;&#039;&#039;from zero to &#039;&#039;&#039;r&#039;&#039;&#039; we can calculate the number of particles that are located within the distance &#039;&#039;&#039;r&#039;&#039;&#039; from the central atom. At very small &#039;&#039;&#039;r &#039;&#039;&#039;values &#039;&#039;&#039;g(r) &#039;&#039;&#039;is zero as at this distance the particles would be too close to each other and the repulsive forces would be extremely high. &#039;&#039;&#039;Figure 12&#039;&#039;&#039; shows the comparison of RDFs at &#039;&#039;&#039;T = 1.2&#039;&#039;&#039; for gas (density = 0.07), liquid (density = 0.8) and solid (density = 1.2). &lt;br /&gt;
&lt;br /&gt;
In the case of gas, we see a single peak and then the RDF decays to 1 - this shows us that in gas phase only the position of the nearest particles is affected by the central atom and there is no long distance order within the system. In the case of liquid, we observe 3-4 detectable peaks - this means the interactions between particles in the liquid phase are effective over longer distances - in our case there is detectable effect of the central atom on the particles within 3-4 interatomic distance - another aspect of the liquid RDF is the presence of parts of RDF that are below 1 - we have our central particle and then there are particles (green particles in &#039;&#039;&#039;Figure 14&#039;&#039;&#039;) that are likely to be found around &#039;&#039;&#039;r = 1.1 &#039;&#039;&#039;this then makes it unlikely for particles to be found at &#039;&#039;&#039;r = 1.5&#039;&#039;&#039; (purple line &#039;&#039;&#039;Figure 14&#039;&#039;&#039;) as at this distance particles would strongly repel with the particles at &#039;&#039;&#039;r = 1.1 &#039;&#039;&#039;- then there is again region of increased likelihood (red particles in &#039;&#039;&#039;Figure 14&#039;&#039;&#039;) but the effects decay within 3-4 distances after which the relatively fast movement of particles in liquid phase averages out any effect of the central atom on the relative structure at these larger distances (blue particles in &#039;&#039;&#039;Figure 14&#039;&#039;&#039;). &lt;br /&gt;
&lt;br /&gt;
In the case of solid, the particles are fixed in crystalline lattice and cannot move around like they did in gas and liquid - this significantly increases the ability to predict the likelihood of finding particles even at large distances - the factor that slowly averages the RDF to zero at large distance in solids is the vibrational motion - thus we would expect to observe better resolution of the RDF at lower temperatures where the vibrational energy of the system is lower - this is exactly what is observed in &#039;&#039;&#039;Figure 13&#039;&#039;&#039; which shows comparison of RDF of solid at 2 different temperatures - the better resolution (sharper peaks) is apparent for the system with &#039;&#039;&#039;T = 0.3&#039;&#039;&#039;. In our input script we set up the lattice as face-centered cubic, we now compare data obtained from the RDF with the expected ordering in fcc lattice. We integrated the RDF from zero to the 3 values highlighted in &#039;&#039;&#039;Figure 13 &#039;&#039;&#039;- i.e. the &#039;&#039;&#039;r&#039;&#039;&#039; values corresponding to the minima after each of the first 3 peaks. &lt;br /&gt;
&lt;br /&gt;
For integration up to the end of the first peak (r = 1.2), we get a value of &#039;&#039;&#039;12.4&#039;&#039;&#039; which correspond well to the expected coordination number in fcc lattice for the &#039;&#039;&#039;12&#039;&#039;&#039; nearest neighbors - the 12 red spheres shown in&#039;&#039;&#039; Figure 15&#039;&#039;&#039;.&#039;&#039;&#039; &#039;&#039;&#039;When integrating up to the end of the second peak (r = 1.67), we get a value of 18.0 which corresponds to the expected coordination number for the sum of the nearest neighbors (red spheres) and the new 6 next-nearest neighbors (green spheres in &#039;&#039;&#039;Figure 15&#039;&#039;&#039;). The ratio between the &#039;&#039;&#039;r&#039;&#039;&#039; values of the first two peaks is also in good agreement with expected 1 vs 2&amp;lt;sup&amp;gt;0.5&amp;lt;/sup&amp;gt;. The inter-layer distance can be calculated as a height in trigonal pyramid with edge-length equal to the distance between the nearest neighbors which is in our case 1.05 and thus the lattice spacing is &#039;&#039;&#039;0.70&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;r&#039;&#039;&#039; value of the third peak is again at expected position 3&amp;lt;sup&amp;gt;0.5&amp;lt;/sup&amp;gt; which corresponds to the distance of blue spheres in &#039;&#039;&#039;Figure 15&#039;&#039;&#039; from the central grey one. There are 24 spheres of the blue type and thus we would expect the coordination number to be 18+24=42. However, by integrating the RDF up to  to the end of the third peak (r = 2.0) we obtain value of only 28 - thus there is a strong disagreement between our predicted result and the obtained value - which is in strong contrast with the good agreement for the first two peaks. However, the overall expected trend - alternating peaks corresponding to the face-centred particles (higherpeak) and the corner-based particles (smaller peak) is apparent over large distances from the central particle.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:JV-1214-rdfmain.png|thumb|650x650px|&#039;&#039;&#039;Figure 12&#039;&#039;&#039; - RDFs for gas, liquid and solid phases in Lennard Jones system.]]&lt;br /&gt;
|[[File:JV-1214-rdf3.png|thumb|650x650px|&#039;&#039;&#039;Figure 13&#039;&#039;&#039; - Comparison of RDF of Lennard-Jones solid at different temperatures.]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:JV-1214-liq-coord.png|thumb|400x400px|&#039;&#039;&#039;Figure 14&#039;&#039;&#039; - Ordering of particles in liquid phase.|centre]]&lt;br /&gt;
|[[File:JV-1214-solid-graph.png|thumb|400x400px|&#039;&#039;&#039;Figure 15&#039;&#039;&#039; - Lattice plan for the solid with fcc lattice.|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice idea to look at the effect of temperature on the solid phase RDF.  Good diagram of the fcc lattice to show which atoms are responsible for which peaks, but the lattice parameter is the length of the unit cell, it should be about 1.5 for your simulations, not 0.7.  Show a plot of the integral of the RDF, it should show 42 for the integral up to the third peak, are you sure you were looking at the value of r corresponding to the third peak?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 5&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 5: &#039;&#039;&#039;We are out of ideas, just have a snack or something.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= MISSION 6: Dynamical properties and the diffusion coefficient =&lt;br /&gt;
&#039;&#039;&#039;OBJECTIVE: &#039;&#039;&#039;Examine diffusion-related aspects of the simulations and finally finish the project.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REPORT : &#039;&#039;&#039;Fist we look at the mean square displacement (MSD) for the gas, liquid and solid phases simulated in &#039;&#039;&#039;Mission 5&#039;&#039;&#039;. MSD is a measure of the extent of random motion - at constant temperature and thus with constant mean square velocities in our system we expect MSD to increase linearly. Also, we expect the slope to be steepest for gas and to be almost zero for the solid - as gas particles have the highest velocity while the solid particles are mostly fixed in the crystalline lattice. The obtained results are shown in &#039;&#039;&#039;Figure 16 &#039;&#039;&#039;- and the expected behavior is observed. Within the very first few steps (apparent in Figure &#039;&#039;&#039;17&#039;&#039;&#039;) it takes some time for the linear trend to start, thus when obtaining the slope from linear fit, these points are excluded. By multiplying the slope of MSD by &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \frac{1}{6} &amp;lt;/math&amp;gt; and by dividing by the value of time-step in reduced units (0.002) we obtain the diffusion coefficients &#039;&#039;&#039;D&#039;&#039;&#039; for our phases as follows: &#039;&#039;&#039;D(gas) = 2 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(liquid) = 0.085 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(solid) = 4.1*10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039;.  Here the small diffusivity of solid is even more apparent. However, the diffusion factor is temperature dependent as shown in &#039;&#039;&#039;Figure 17&#039;&#039;&#039; by the comparison of the MSD for solid at two different temperatures - by increasing the temperature from 0.3 to 1.2 (i.e. 4-times) the diffusion coefficient of the solid increases 4.7-times to &#039;&#039;&#039;1.93*10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039; - this trend is expected as with increasing temperature the energy in the system increases and makes it more likely for the particles to diffuse even in the solid phase. Density is expected to have opposite effect.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The units are not m2s-1 unless the units of sigma are in metres.  Why does the gas phase MSD begin as a curved line (ballistic motion)?  The solid phase MSD seems to increase over time, is this what you&#039;d expect for a solid?  Have you started from an fcc or sc solid here?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Figures 18&#039;&#039;&#039; and &#039;&#039;&#039;19&#039;&#039;&#039; show a comparison between MSDs from our simulation and from simulation with much larger number of particles. The overall trend between different phases is the same. The difference between the curves can be explained by the effect of different simulation temperatures or densities.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|[[File:JV-1214-msd1.png|thumb|500x500px|&#039;&#039;&#039;Figure 16&#039;&#039;&#039; - Total mean square displacement for Lennard-Jones gas, solid and liquid.]]&lt;br /&gt;
|[[File:JV-1214-msd2.png|thumb|500x500px|&#039;&#039;&#039;Figure 17&#039;&#039;&#039; - Comparison in total mean square displacement of solid at different temperatures.]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:JV-1214-msd3.png|thumb|500x500px|&#039;&#039;&#039;Figure 18&#039;&#039;&#039; - Comparison of the MSD from our simulations with MSDs from simulations of 1000000 atoms.]]&lt;br /&gt;
|[[File:JV-1214-msd4.png|thumb|500x500px|&#039;&#039;&#039;Figure 19&#039;&#039;&#039; - Comparison of the MSD from our simulations with MSDs from simulations of 1000000 atoms.]]&lt;br /&gt;
|}&lt;br /&gt;
Next, we evaluate the velocity autocorrection function (VACF) for our three phases as this can also be used to calculate the diffusion coefficient. We first find the solution of the VACF for the classical harmonic oscillator discussed in &#039;&#039;&#039;Mission 1&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \text{classical harmonic oscillator: } x(t) = Acos({\omega}t+\phi) \text{   } {\Longrightarrow} \text{   } v(t) = {\operatorname{d}\!x(t)\over\operatorname{d}\!t} = -A{\omega}sin({\omega}t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \text{normalised velocity autocorrelation function for a 1D harmonic oscillator: } C(\tau) = \frac{\int\limits_{-\infty}^{\infty}v(t)v(t+\tau)\, dt}{\int\limits_{-\infty}^{\infty}{v^{2}(t)}\, dt} = \frac{\int\limits_{-\infty}^{\infty}A^{2}{{\omega}^2}sin({\omega}t+\phi)sin({\omega}(t+\tau)+\phi)\, dt}{\int\limits_{-\infty}^{\infty}A^{2}{{\omega}^2}(sin({\omega}t+\phi))^{2}\, dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \text{cross-out constants: } \frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)sin({\omega}(t+\tau)+\phi)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} = \frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)sin({\omega}t+\phi+\omega\tau)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \text{use: } sin(a+b) = sin(a)cos(b) + cos(a)sin(b) \text{ and take out constant terms: } \frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)sin({\omega}t+\phi)cos(\omega\tau)+sin({\omega}t+\phi)cos({\omega}t+\phi)sin(\omega\tau)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} = cos(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)sin({\omega}t+\phi)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} + sin(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)cos({\omega}t+\phi)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt}&amp;lt;/math&amp;gt;&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; cos(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^2\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} + sin(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)cos({\omega}t+\phi)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the left fraction we now have the same function in nominator and denominator which are both divergent in exactly the same way as they are the same function and we can write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; cos(\omega\tau) + sin(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}sin({\omega}t+\phi)cos({\omega}t+\phi)\, dt}{\int\limits_{-\infty}^{\infty}(sin({\omega}t+\phi))^{2}\, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the remaining fraction, in nominator we use the identity: &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; cos(a)sin(a) = \frac{1}{2}(sin(2a))&amp;lt;/math&amp;gt; and in denominator we use: &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; (sin(a))^2 = 1-(cos(a))^2 = (cos(a))^2 - cos(2a) =  \frac{1}{2}(1-cos(2a))&amp;lt;/math&amp;gt;. Thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; cos(\omega\tau) + sin(\omega\tau)\frac{\int\limits_{-\infty}^{\infty}cos(2({\omega}t+\phi))\, dt}{\int\limits_{-\infty}^{\infty}\frac{1}{2}(1-cos(2({\omega}t+\phi)\, dt} = cos(\omega\tau) + sin(\omega\tau)\frac{\left[-\frac{cos(2({\omega}t+\phi))}{4\omega} \right]_{-\infty}^{\infty}}{\left[\frac{2({\omega}t+\phi)-sin(2({\omega}t+\phi))}{4\omega} \right]_{-\infty}^{\infty}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; C(\tau) = cos(\omega\tau) + sin(\omega\tau){\left[{\frac{-\frac{cos(2({\omega}t+\phi))}{4\omega}}{\frac{2({\omega}t+\phi)-sin(2({\omega}t+\phi))}{4\omega}}}\right]_{-\infty}^{\infty}} = cos(\omega\tau) + sin(\omega\tau){\left[{\frac{-{cos(2({\omega}t+\phi))}}{2({\omega}t+\phi)-sin(2({\omega}t+\phi))}}\right]_{-\infty}^{\infty}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we evaluate the limits: &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\lim_{t \to \infty}{\frac{-{cos(2({\omega}t+\phi))}}{2({\omega}t+\phi)-sin(2({\omega}t+\phi))}}&amp;lt;/math&amp;gt; and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\lim_{t \to -\infty}{\frac{-{cos(2({\omega}t+\phi))}}{2({\omega}t+\phi)-sin(2({\omega}t+\phi))}}&amp;lt;/math&amp;gt;. And since the range of values for both sine and cosine is between -1 and +1 along the whole t-axis - these limits tend to zero as t goes to ±&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\infty&amp;lt;/math&amp;gt; due to the part &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;2({\omega}t+\phi)&amp;lt;/math&amp;gt; which approaches ±&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\infty&amp;lt;/math&amp;gt; and is in denominator. Thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; C(\tau) = cos(\omega\tau) + sin(\omega\tau)*0 = cos(\omega\tau) &amp;lt;/math&amp;gt;[[File:JV-1214-vacf1.png|thumb|500x500px|&#039;&#039;&#039;Figure 20&#039;&#039;&#039; - VACF for Lennard-Jones liquid and solid compared to VACF of classical harmonic oscillator.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This derivation can be simplified by noticing that sin(x)*cos(x) is an odd function and so its integral with limits which are symmetric about zero, is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACF describes the dependence of the velocity after several time-steps on the initial velocity. Thus, in classical harmonic oscillator the above-obtained harmonic result is expected - i.e. if we start with some initial velocity at some initial displacement then we expect for the particle in the classical harmonic oscillator to have the same-in-value-but-opposite-in-direction velocity after &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt; \frac{\pi}{\omega} &amp;lt;/math&amp;gt; time-steps have passed which correspond to the minima in the VACF plot. However, in the cases of Lennard-Jones solids and liquids which instead follow the potential curve shown in &#039;&#039;&#039;Figure 5&#039;&#039;&#039;, we expect a damped oscillator behaviour instead. Further, we would expect the dampening to be weaker in the solid phase as the solid phase with the crystalline lattice more closely resembles the classical harmonic oscillator.  &lt;br /&gt;
&lt;br /&gt;
Our simulation data shown in &#039;&#039;&#039;Figure 20&#039;&#039;&#039; agree with these predictions. Stronger dampening is observed for liquid phase compared to solid phase. In gas phase (not shown in our figures)  the dampening is above the critical limit and thus only exponential decay without any harmonic behaviour is observed for the VACF of gas phase. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient can be obtained by integrating the VACF from zero to infinity with respect to time-step and dividing by 3. We use the trapezium rule to approximate the integrals under the VACFs for the gas, liquid and solid phases - the plot of the running integral is shown in &#039;&#039;&#039;Figure 21&#039;&#039;&#039;. However, as we only run 5000 time-steps instead of infinity, the running integral does not reach full plateau especially in case of the gas phase and this is a significant source or error in our estimate of &#039;&#039;&#039;D&#039;&#039;&#039; from VACF. The running integral is highest for gas phase and lowest for solid phase which agrees with the expected diffusions coefficients as discussed above. From VACF, we obtain the diffusion coefficients &#039;&#039;&#039;D&#039;&#039;&#039; for our phases as follows: &#039;&#039;&#039;D(gas) =  1.16 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(liquid) = 0.05 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(solid) = 3.7*10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1 &amp;lt;/sup&amp;gt;&#039;&#039;&#039;- compare with results from MSD: &#039;&#039;&#039;D(gas) = 2 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(liquid) = 0.085 m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, D(solid) = 4.1*10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;s&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;. &#039;&#039;&#039;The results are relatively close in values and the best agreement is observed for the solid phases - i.e. the most ordered system. The value obtained from the VACF for gas is quite lower which agrees with our proposed source of error - i.e. the fact that the running integral under VACF does not have time to reach plateau (and thus higher values of D) within the 5000 simulated time-steps - by running longer simulations the diffusion coefficients from the two methods could be expected to converge at the same value. &#039;&#039;&#039;Figure 22&#039;&#039;&#039; shows the running integrals also for the simulations with much larger number of atoms - and as in case of MSD the values reached by these simulations are higher that those reached with our simulated smaller number of particles - which we again attribute to higher temperature or lower density in the more-particle simulation. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:JV-1214-vacf3.png|thumb|500x500px|&#039;&#039;&#039;Figure 21&#039;&#039;&#039; - Running integral under VACF of Lennard-Jones gas, liquid and solid. ]]&lt;br /&gt;
|[[File:JV-1214-vacf4.png|thumb|500x500px|&#039;&#039;&#039;Figure 22&#039;&#039;&#039; - Running integral under VACF of Lennard-Jones gas, liquid and solid - comparison of simulation with higher number of particles. ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Collision between particles randomise the particle velocities and cause the VACFs to decay, there are no collisions in the harmonic oscillator.  Plot the integrals on separate graphs as it is hard to see the results for the solid and liquid.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS IS THE END OF MISSION 6&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REWARD 6: &#039;&#039;&#039;You got through the whole thing - that&#039;s a reward by itself. Congratulation! &lt;br /&gt;
&lt;br /&gt;
= REFERENCES&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039; =&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:sh5214_liquid_simulation&amp;diff=602788</id>
		<title>Talk:Mod:sh5214 liquid simulation</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:sh5214_liquid_simulation&amp;diff=602788"/>
		<updated>2017-03-16T05:47:22Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes.  Add a bit more detail to your written answers to show that you have a good overall u...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes.  Add a bit more detail to your written answers to show that you have a good overall understanding of the experiment and show your working for calculations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim theory analytical.png]] [[File:Sh5214 liquid sim theory energy.png]] [[File:Sh5214 liquid sim theory error.png ‎]]&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim theory error maxima.png ]]&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maximum timestep that doesn&#039;t result in more than an 1% change in energy is around 0.45. The reason why the energy is monitored is to make sure the energy change between each timestep is not too large. If there is a large energy difference, it would mean that the overall change in velocity of the particles in the system is too large, which would lead to not obtaining the full amount of information from the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you be more specific, energy should be conserved so we need to check that energy is approximately constant to ensure that the simulation results are physical.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
The value of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, for which potential energy is 0, is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The force at this seperation is &amp;lt;math&amp;gt;F=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is &amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-2\epsilon&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.0248(3sf)&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.00818(3sf)&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.00329(3sf)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The well depth is epsilon, not 2*epsilon.  Otherwise the maths is correct, but show your working.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of water molecules in 1mL water = 0.0556 moles (3sf) = 3.35e22 molecules (3sf)&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules = 2.99e-19 mL (3sf) = cube with side length of ~ 6.69 nm (3sf)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but show some working.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After PBC has been applied the atom will be at (0.2,0.1,0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\times\sigma=3.2\times0.34=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\frac{\epsilon}{k_B}=1.5\times120=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right)=-6.16\times10^{-24}Jmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: r and T are correct, but phi is not - again show some working.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If atoms are created too close, then we will have a very large potential, meaning that if the timestep is not reduced, then we will have a large change in energy between timesteps which could mean that we do not obtain all the information from the simulation system. However if we decrease the timestep so that the change in energy is reduced to a suitable size, then it would require much more calculations to run the simulation for the same of time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic: 0.8 density = 1.25 cell volume = &amp;lt;math&amp;gt;\sqrt[3]{1.25}&amp;lt;/math&amp;gt; = 1.07722 cell length.&lt;br /&gt;
&lt;br /&gt;
Face centre cubic: 1.2 density = 0.833 cell volume = &amp;lt;math&amp;gt;\sqrt[3]{0.833}&amp;lt;/math&amp;gt; = 0.941 cell length.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: An FCC lattice has 4 atoms per unit cell, so the side length should be (4/1.2)^(1/3) = 1.49.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
FCC contains 4 atoms in each lattice cell, SC contains 1 atom in each lattice cell, thus 4000 atoms would be created if FCC was used.&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0: mass of atom type 1 is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: cut-off for lennard jones interaction is 3 unit length&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: pair_coeff refers to the force field coeffecients for pairs of atoms, * * means between any two atom types, 1.0 is the coefficient&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field coefficients for a Lennard Jones simulation?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Velocity velvet integration&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason why a variable is used to hold the value of timestep is so that it is more convenient to change the value of timestep, as you would only have to change the line that defines the timestep instead of going through the whole code and changing all instances where timestep is used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim intro 001 energy.png]] [[File:Sh5214 liquid sim intro 001 temp.png]] [[File:Sh5214 liquid sim intro 001 pressure.png]] [[File:Sh5214 liquid sim intro all energy.png]] [[File:Sh5214 liquid sim intro all energy zoom.png]]&lt;br /&gt;
&lt;br /&gt;
From the plot of energy vs time for timestep = 0.001 we can see that equilibrium is reached, and from the last plot it can be seen that it takes about 0.4 units of time to reach equilibrium. The largest timestep that results in the equilibration of energy is timestep = 0.01. Timestep = 0.015 is a bad choice because the system does not equilibrate and instead diverges.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Which timestep did you choose?  Average total energy shouldn&#039;t depend on choice of timestep so 0.01 and 0.0075 are not suitable.  0.0025 and 0.001 have the same average energy so choose the larger timestep so that simulations will cover more time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&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 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\implies \frac{1}{2}\sum_i m_i v_i^2=\frac{3Nk_B\mathfrak{T}}{2\gamma^2}=\frac{3}{2}Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\implies \gamma^2=\frac{\mathfrak{T}}{T} \implies\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100: number of timesteps between each sample&lt;br /&gt;
&lt;br /&gt;
1000: number of samples for each average&lt;br /&gt;
&lt;br /&gt;
100000: number of timesteps required to obtain one average&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim npt density temperature.png]]&lt;br /&gt;
&lt;br /&gt;
My simulated density is lower than the density predicted by the idea gas law, this discrepancy increases with pressure. The reason why the deal gas law gives a higher density is due to the fact that it doesn&#039;t take into account the interactions between atoms, hence repulsions between atoms are not accounted for in the ideal gas law, this means that the atoms would be closer together in the idea gas law and so a higher density.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, how does the discrepancy change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 nvt heat capacity.png]]&lt;br /&gt;
&lt;br /&gt;
From the graph it can be seen that specific heat capacity decreases with temperature, this is expected because there is a limit to how much energy a molecule can hold, as the temperature of the molecule increases, the amount of available rotational/vibrational energy level that the molecule can be excited into decreases, meaning that the molecule will be able to store less energy as its temperature increases.&lt;br /&gt;
&lt;br /&gt;
We can also see that the specific heat capacity for the system with 0.8 density is higher than the system with 0.2 density, this is expected because a higher density means that there are more molecules per unit volume, and therefore more energy could be stored per unit volume.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are just simulating spherical particles, not molecules, so there is no rotational or vibrational energy.  Also remember that your simulations are classical.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable D equal 0.2&lt;br /&gt;
lattice sc ${D}&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 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 vdamp 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;
## SWITCH OFF THERMOSTAT ##	&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 vol&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable N2 equal atoms*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 etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2 v_vol &lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable errtemp equal sqrt(f_aves[6]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable cv equal (${N2}*(f_aves[8]-f_aves[4]*f_aves[4])/(${T}*${T}))&lt;br /&gt;
variable V equal f_aves[9]&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;cv: ${cv}&amp;quot;&lt;br /&gt;
print &amp;quot;volume: ${V}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&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;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim rdf plot.png]]&lt;br /&gt;
&lt;br /&gt;
Firstly the range of peaks for solids is longer than liquids which is longer than gas, this means that in the system of solids, the atoms are more ordered than the atoms in the system of liquids, which are more ordered than the atoms in the system of gases. Another observation that could be made is that the magnitude of the peaks decreases as r increases, this is because g(r) is calculated by number of atoms in the shell divided by volume of shell and the density of the system, as r increases, the volume of the shell will increase at a faster rate than the number of atoms in the shell, and thus g(r) decreases. Also it can be seen that magnitude of the peaks of the RDF of the solid is greater than both liquid and gas, this is because solids are more closely packed and more ordered than both gas and liquid, hence at certain r values there will be a high number of atoms and at other r values there will be a very low number of atoms, and that&#039;s why solids have higher peaks and lower troughs.&lt;br /&gt;
&lt;br /&gt;
The first peak for the solid RDF is at r=1.025 and the second peak is at r=1.425, thus the lattice spacing is 0.4 times the interatomic separation. There are three different planes in a fcc crystal, they have miller indices of (1,1,1) (1,1,0) and (1,0,0). The (1,1,1) plane corresponds to the first peak and has a coordination number of 6 atoms, the (1,1,0) plane corresponds to the second peak and has a coordination number of 2, the (1,0,0) plane corresponds to the third peak and has a coordination number of 4. The coordination number of lattice sites will affect the magnitude of the peak, and that&#039;s why magnitude of first peak &amp;gt; third peak &amp;gt; second peak&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Did you plot the integral of g(r)?  This will tell you the area under each peak which is the coordination number for that peak, the coordination numbers should be 12 for the first peak, 6 for the second and 24 for the third.  Drawing a diagram of an fcc lattice to show which atoms are responsible for each peak might help.  The lattice spacing is the width of the unit cell.  You can calculate this from each of the first three peaks separately and then calculate the average.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&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 simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim d gas msd.png]] [[File:Sh5214 liquid sim d liquid msd.png]] [[File:Sh5214 liquid sim d solid msd.png]]&lt;br /&gt;
&lt;br /&gt;
Gas MSD (my data):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=2000, MSD=29.2&lt;br /&gt;
t=5000, MSD=104.7&lt;br /&gt;
gradient = (104.7-29.2)/3000 = 0.0252 (3sf)&lt;br /&gt;
D = gradient/6 = 0.00419 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gas MSD (1e6 atoms): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=2000, MSD=36.4&lt;br /&gt;
t=5000, MSD=144.4&lt;br /&gt;
gradient = (144.4-36.4)/3000 = 0.036&lt;br /&gt;
D = gradient/6 = 0.006 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Liquid MSD (my data): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=0, MSD=0&lt;br /&gt;
t=5000, MSD=11&lt;br /&gt;
gradient = 11/5000 = 0.0022&lt;br /&gt;
D = gradient/6 = 0.000367 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Liquid MSD (1e6 atoms): &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=0, MSD=0&lt;br /&gt;
t=5000, MSD=5.19&lt;br /&gt;
gradient = 5.19/5000 = 0.00104 (3sf)&lt;br /&gt;
D = gradient/6 = 0.000173&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid MSD (my data): D=0&lt;br /&gt;
&lt;br /&gt;
Solid MSD (1e6 atoms): D=0&lt;br /&gt;
&lt;br /&gt;
MSD is the average distance traveled by a particle in a system, it can be seen that the MSD of the solid plateaus very early on and at a very low value this is due to the fact that atoms in a solid are rigid and fixed in place therefore average distance traveled by a atom in a solid is very small. We see that the MSD plot of the gas starts off as a parabola before turning linear, the parabola part corresponds to when gas atom doesn&#039;t collide with anything else meaning that during this time the velocity of the atom is constant and so distance increases proportional to time squared, when more and more collisions occur the curve goes from parabolic to linear. In the liquid MSD plot, we can see that at the start of the curve for a short amount of time the curve is not linear, this is because little to no collisions occur right at the start of the simulation, for most of the plot the line is linear due to the fact that there are collisions between liquid atoms.&lt;br /&gt;
&lt;br /&gt;
The magnitude of MSD for gas &amp;gt; liquid &amp;gt; solid, this is due to the fact that density of gas &amp;lt; liquid &amp;lt; solid, a lower density means that less collisions occur and thus the average translational velocity of atoms is higher, resulting in greater distance traveled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of the curve in the gas MSD.  Show the lines of best fit that you used to calculate D on your graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau)=\frac{\int_{-\infty}^{\infty}-A\omega sin(\omega t+\phi).-A\omega sin(\omega t+\omega\tau+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty}A^2\omega^2sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\int_{-\infty}^{\infty}0.5A^2\omega^2[cos(\omega\tau)-cos(2\omega t+\omega\tau+2\phi)]dt}{\int_{-\infty}^{\infty}0.5A^2\omega^2-0.5A^2\omega^2cos(2\omega t+2\phi)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{[0.5A^2\omega^2cos(\omega\tau)t+0.25A^2\omega sin(2\omega t+\omega\tau+2\phi)]_{-\infty}^\infty}{[0.5A^2\omega^2t+0.25A^2\omega cos(2\omega t+2\phi)]_{-\infty}^\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that sine and cosine has a range of -1 to 1, hense the above equation can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx\frac{[0.5A^2\omega^2cos(\omega\tau)t]_{-\infty}^\infty}{[0.5A^2\omega^2t]_{-\infty}^\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx cos(\omega\tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct final result, but you need to check the derivation again.  You don&#039;t have to calculate any of the integrals if you use a trigonometric identity for sin(A+B) to split up one of the sin terms and then realise that the integral of an odd function over limits which are symmetric about zero is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquide sim d solid liquid cos vacf normalised.png]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represents the time at which the velocity of the atoms in the system is at a maximum. We can see that the VACF for solids oscillates about zero, with the amplitude of the oscillation will decrease over time, this is due to the fact that the atoms in the solids are locked up in a lattice, these atoms in the lattice will want to be at the optimal position where the repulsive forces and attractive forces balance out, they will therefore oscillate about this position which will also result in an oscillation in velocity, the reason why the magnitude of these oscillation decreases over time is because of other forces that perturb the oscillation. We can see that there is also a very slight minima on the liquid VACF curve, which shows that liquids also oscillate but the oscillation disappears very quickly, the reason why atoms in liquids don&#039;t oscillate for as long as solids is because liquid atoms are not locked in a lattice like solids and so are free to move, this means that any oscillation is very quickly dampened out by diffusion.&lt;br /&gt;
&lt;br /&gt;
The reason why the harmonic oscillator VACF is so different is due to the fact that it doesn&#039;t take into account dampening of the oscillation, hence the magnitude of the oscillation never decreases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The harmonic oscillator doesn&#039;t decay because there are no collisions.  In the solid and liquid VAFCs, successive collisions randomise the particle velocities and so, since the VACF is calculated as an average over all particles, it decays to zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Sh5214 liquid sim d gas integral vacf.png]] [[File:Sh5214 liquid sim d liquid integral vacf.png]] [[File:Sh5214 liquid sim d solid integral vacf.png]]&lt;br /&gt;
&lt;br /&gt;
Gas VACF (my data):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=5000, Running Integral=6.54 (3sf)&lt;br /&gt;
D = Running Integral/3 = 2.18 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gas VACF (1e6 atoms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=5000, Running Integral=9.81 (3sf)&lt;br /&gt;
D = Running Integral/3 = 3.27 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Liquid VACF (my data):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=5000, Running Integral=0.569 (3sf)&lt;br /&gt;
D = Running Integral/3 = 0.190 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Liquid VACF (1e6 atoms):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t=5000, Running Integral=0.270 (3sf)&lt;br /&gt;
D = Running Integral/3 = 0.0901 (3sf)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solid VACF (my data): D = 0&lt;br /&gt;
&lt;br /&gt;
Solid VACF (1e6 atoms): D = 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How does this method compare to the MSD and what was the main source of error?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602787</id>
		<title>Talk:Mod:paxtonchia250893</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602787"/>
		<updated>2017-03-16T05:45:17Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with clearly written answers to all tasks.  You could add a bit more detail to some of your discussions of your own results though and use the background theory to the experiment to support your explanations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
=== Velocity Verlet Algorithm ===&lt;br /&gt;
&lt;br /&gt;
By using the data and formulas given in HO.xls, the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot; were completed. ANALYTICAL was filled in using the formula for the classical harmonic oscillator &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. ERROR was determined by the absolute difference between the ANALYTICAL and the velocity-Verlet solution while ENERGY is calculated by adding up both potential and kinetic energy of the harmonic oscillator. The formula for ENERGY is given by &amp;lt;math&amp;gt;\frac{1}{2}kx^{2} + \frac{1}{2}mv^{2}&amp;lt;/math&amp;gt;. The graphs of the three variables with respect to time are shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 analytical.png|800px|thumb|center|Graph of ANALYTICAL against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 energy.png|800px|thumb|center|Graph of ENERGY against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error.png|800px|thumb|center|Graph of ERROR against Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the default timestep, the positions of the maxima are estimated at t = 2.00, 4.90, 8.00, 11.10 and 14.20. These points are plotted against time and a linear function is fitted to the data as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error maxima.png|800px|thumb|center|Graph of ERROR MAXIMA against Time with fitted linear function]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Different timesteps are experimented and the maximum change in energy is plotted as a percentage against time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 change in energy.png|800px|thumb|center|Graph of Maximum % Change in Energy against Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the above graph, as the timestep increases, the change in energy also increases. Hence, a small timestep (&amp;amp;le;0.200) is required to ensure that the total energy does not change by more than 1% over the course of the simulation. It is important to monitor the total energy of a physical system when modelling its behaviour numerically to ensure that the error in calculating the properties of the system are not large.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good thorough analysis of the timestep, why does the error oscillate?  Energy should be conserved so we need to make sure this is approximately true in our simulations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Single Lennard-Jones Interaction ===&lt;br /&gt;
&lt;br /&gt;
Working with a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt; was substituted into the equation &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; to find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. The results obtained are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} = 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;\sigma^{12} - \sigma^{6}r^6 = 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;r^6 = \sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The force at this separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, can be calculated using the formula &amp;lt;math&amp;gt;F = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r} = 4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;F \left( r_0 \right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12}{\sigma} + \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force, &amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt;, is zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} = 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;-12\sigma^{12} + 6\sigma^{6}r^6 = 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;r^6 = 2\sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well-depth, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;, is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &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;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_2^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2)^{11}} - \frac{1}{5(2)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&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&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2.5}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_{2.5}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2.5)^{11}} - \frac{1}{5(2.5)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{3}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_3^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(3)^{11}} - \frac{1}{5(3)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
To estimate the number of water molecules given a volume under standard conditions, the following equation can be used:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Volume} \times \mathrm{Density}}{\mathrm{Molar}\ \mathrm{mass}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules\ in\ 1mL\ of\ water}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{1 \times 1}{18}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0556 \ \mathrm{mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.35 \times 10^{22} \ \mathrm{molecules}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the equation can be rearranged to find the volume of water given the number of molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Volume}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Number\ of\ water\ molecules} \times \mathrm{Molar}\ \mathrm{mass}}{\mathrm{Density}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Volume\ of\ 10000\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{10000 \times 18}{1 \times 6.022 \times 10^{23}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;2.99 \times 10^{-19} \ \mathrm{mL}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hence, realistic volumes of liquid cannot be simulated and periodic boundary conditions are used. This can be illustrated in the following example. An atom at position &amp;lt;math&amp;gt;(0.5,0.5,0.5)&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;. The atom&#039;s end point before applying the periodic boundary conditions can be found by adding the vector to the atom&#039;s original position, which gives us &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Since the box has the dimensions &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, any value in the end position that is larger than 1 will have 1 subtracted from it after applying the periodic boundary conditions, resulting in &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; as the end point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
By rearranging the equations given,&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;r^* \times \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.2 \times 0.34&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.088 \ \mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac {\epsilon}{k_B}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120 \times 1.380 \times 10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.656 \times 10^{-21} \ \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.997 \ \mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac {T^*\epsilon}{k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;180\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
Generating a random position for each atom to create a simulation box can cause problems in simulations if the atoms are generated close together. This results in a large repulsion between the atoms and may cause the atoms to move too far and out of range in a single timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This can make the simulation crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With a lattice spacing in x,y,z = 1.07722 1.07722 1.07722, the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Since there is one lattice point per unit cell in a simple cubic lattice, the number of lattice points per unit volume (number density) corresponds to &amp;lt;math&amp;gt;\frac {1}{1.25} = 0.8&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice, there are 4 lattice points per unit cell. With a lattice point density of 1.2, the volume of the unit cell is &amp;lt;math&amp;gt;\frac {4}{1.2} = 3.33&amp;lt;/math&amp;gt;. Hence, the length of the unit cell is &amp;lt;math&amp;gt;\sqrt[3]{3.33} = 1.49380&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice was used instead, &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; will be created as there are 4 lattice points per unit cell and the box contains 1000 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Properties of Atoms ===&lt;br /&gt;
&lt;br /&gt;
The purpose of the following commands in the input script are found from the LAMMPS manual&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot;&amp;gt;LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5. Accessed on 17 Feb 2017.&amp;lt;/ref&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&amp;quot; sets the mass for all atoms of type 1 to 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&amp;quot; tells LAMMPS to use the standard 12/6 Lennard-Jones potential between the atoms with a cutoff of 3.0 when calculating the forces. This means that the interaction between a pair of atoms is only calculated if their separation is less than 3.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&amp;quot; sets both the parameters of the Lennard-Jones potential, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, to 1.0 for atom pairs of any type.&lt;br /&gt;
&lt;br /&gt;
If we are specifying the initial position and velocity, we are going to use the velocity verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
The purpose of assigning a value to a text variable (e.g. timestep or n_steps) is for our own convenience. If we need to change the value of the variable, we only need to change the value assigned to the text variable. This only requires us to make a single edit instead of having to change the value every time it is used in the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
The thermodynamics output of the first simulations were analysed to see how long it takes to reach an equilibrium state. Graphs of energy, temperature and pressure against time for the 0.001 timestep experiment are shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro energy.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro temperature.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro pressure.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown above, all three thermodynamic output reached a constant average within the simulation time, which meant that an equilibrium state was reached. From the graph of energy against time, the system reached equilibrium at around t = 0.4.&lt;br /&gt;
&lt;br /&gt;
A single graph of energy against time for all timesteps is plotted as shown:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro all energy.png|1000px|thumb|center|Graph of Energy against Time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 is the largest to give acceptable results as larger timesteps give energies that are higher than that using a timestep of 0.001. Using a timestep of 0.015 is particularly bad because the system did not reach an equilibrium state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy shouldn&#039;t depend on the choice of timestep so all timesteps above 0.0025 are no good.  Choose the largest of the acceptable timesteps - 0.0025 - to allow the simulation to cover as much time as possible.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
=== Thermostats and Barostats ===&lt;br /&gt;
&lt;br /&gt;
Temperature is controlled by multiplying every velocity by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, which can be evaluated as follows, starting from the given equation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{1}{2}\sum_i m_i v_i^2 \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{3}{2} N k_B T \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above line in the input script, &amp;quot;100&amp;quot; means that input values are used every 100 timesteps. &amp;quot;1000&amp;quot; means that 1000 input values are used to calculate the averages. &amp;quot;100000&amp;quot; means that averages are calculated every 100000 timesteps.&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot; /&amp;gt; Values of each variable e.g. temperature will be sampled every 100 timesteps and 1000 measurements contribute to the average. The simulation will run for 100000 timesteps. With a timestep of 0.0025, 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
10 constant pressure/temperature simulations were ran with 5 different temperatures (T = 2, 3, 4, 5, 6) each at 2 different pressures (P = 2, 3). The value of the timestep chosen was 0.0025. Graphs of density against temperature were plotted separately for the 2 pressures. Error bars in both x and y directions and a line corresponding to the density predicted by the ideal gas law were included. As &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; are both 1.0, the ideal gas equation expressed in reduced units is &amp;lt;math&amp;gt;\left( \frac{N}{V} \right) = \frac{P}{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;center&amp;gt;Graph of Density against Temperature at different Pressures&amp;lt;/center&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=2.png|800px|thumb|center|Pressure = 2]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=3.png|800px|thumb|center|Pressure = 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas density for both pressures. This is due to the approximation used in the ideal gas law, where there are no repulsive forces between the particles. However, in the simulation, the atoms are modeled using the Lennard-Jones potential, which accounts for the repulsion between atoms. This causes the atoms in the simulation to be further apart from one another when compared to the ideal gas under the same conditions. Hence, the density of the simulated liquid is lower than the ideal gas.&lt;br /&gt;
&lt;br /&gt;
As pressure increases, the discrepancy increases. This is due to higher pressures causing the atoms to be closer to one another. Hence, the repulsion forces between the atoms in the simulation increases, resulting in larger deviations from the ideal gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, plot results on a single graph to show the trend with pressure more clearly, what about the trend with temperature?  The ideal gas is a good approximation to low density gases, where interparticle interactions are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
10 constant volume/temperature simulations were ran with 5 different temperatures (T = 2.0, 2.2, 2.4, 2.6, 2.8) each at 2 different densities (0.2 and 0.8). A graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; was plotted against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 heatcap.png|800px|thumb|center|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The expected trend is that heat capacity decreases with temperature, which is the trend shown in the graph above. Heat capacity measures the amount of energy required to increase the temperature of the system. As temperature increases, the vibrational energy levels of the system are more accessible and lesser energy will be required to increase the temperature of the system. Hence, heat capacity decreases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a larger density means that there are more atoms per unit volume. Since heat capacity is an extensive property, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; is higher for the simulation with larger density. However, one would expect &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; to be proportional to density but the heat capacity for &amp;lt;math&amp;gt;\rho^* = 0.8&amp;lt;/math&amp;gt; is not 4 times as large as that for &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are simulating a system of spherical particles so there are no vibrational energy levels, but the heat capacity can be related to the density of energy levels (density of states since the system is classical).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An example of my input script is included as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${d}&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;
### 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;
### 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;
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;
###SWITCH OFF THERMOSTAT###&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 vol atoms&lt;br /&gt;
variable dens equal 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 atoms equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_etotal2 v_temp2&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 aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[5]&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*(f_aves[5]-f_aves[4]*f_aves[4])/f_aves[6]&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;Number of atoms: ${atoms}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
The simulations of the Lennard-Jones system were ran for three phases using the values shown in the table below&amp;lt;ref&amp;gt;J. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt; and the RDFs for the three systems are plotted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
!Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Solid&lt;br /&gt;
|1.2&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 rdf.png|800px|thumb|center|RDFs for vapour, liquid and solid phases]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most number of peaks and the peaks are present even at long distances. The liquid phase RDF has a few peaks that are only present at short distances. The vapour phase RDF has only one broad peak and decays the fastest to a constant of one. This is due to the solid phase having long range order where atoms are arranged in a well-defined manner for long distances while the liquid phase only has short range order where nearby atoms are ordered. The vapour phase is the most disordered with no apparent regular arrangement of the atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 fcc.png|thumb|center|Face-centered cubic illustration of nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid phase RDF corresponds to the position of the nearest neighbour, second nearest neighbour and third nearest neighbour respectively. The diagram above shows the positions of these three nearest neighbour with respect to the lattice site in yellow. The lattice site in red is the nearest neighbour, while the lattice site in blue is the second nearest neighbour and the lattice site in green is the third nearest neighbour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intgr.png|800px|thumb|center|Running Integral of RDF for solid phase]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is the distance of the second nearest neighbour, which is 1.475 as shown in the graph above. This also corresponds to the theoretical value calculated [[#Simulation_Box|above]] (1.49380) for a FCC lattice with a lattice point density of 1.2. The coordination number for each of the three peaks can be obtained from the integrals of the peaks as shown above. The coordination number of the first peak is 12. As the graph shows a running integral, the coordination number of the second peak is 17.98 - 12.02 ≈ 6 while the coordination number of the third peak is 42.31 - 17.98 ≈ 24.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice diagram to show which atoms are responsible for the first three peaks, do the coordination numbers that you&#039;ve got from the integral of g(r) make sense based on the fcc structure?  Could you have calculated the lattice parameter from each of the first three peaks separately, by expressing the distances to these atoms in terms of the lattice parameter using the geometry of an fcc lattice, and then calculated an average rather than just giving the value from the second peak?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
Mean squared displacement of solid, liquid and gas simulations as a function of timestep are plotted. The diffusion coefficient is estimated from the gradient of the total MSD against timestep graph.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001019}{0.002} \right) = 0.0849 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001047}{0.002} \right) = 0.0873 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.02006}{0.002} \right) = 1.67 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.036997}{0.002} \right) = 3.08 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trend in the MSD graphs are as expected. The total MSD for the solid simulation stays approximately constant at 0.02 as the solid atoms are fixed in their lattice positions. This is also seen from its negligible diffusion coefficient. The total MSD for both liquid and gas increases linearly with time. However, the total MSD for gas increases much faster than that for liquid, which is also reflected in the larger diffusion coefficient. This is due to the gaseous atoms having weaker intermolecular forces between each other and being able to move more freely than liquid atoms.&lt;br /&gt;
&lt;br /&gt;
For the large system, the trends in the MSD graphs are similar to that for a small system except for the gas phase. For solid and liquid, the MSD graphs and diffusion coefficients are approximately the same in both the large and small system. However, the total MSD for solid showed lesser fluctuations in the large system. On the other hand, the total MSD for gas increases much faster in the large system than the small system, which results in a larger diffusion coefficient as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you divide by 0.002 when you calculate the diffusion coefficient?  Why is the gas MSD curved initially (ballistic motion), before eventually becoming linear?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator is evaluated as followsː&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;A \cos \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{d}x(t)}{\mathrm{d}t} = -A \omega \sin \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} A^2 \omega^2 \sin\left(\omega t+ \phi \right) \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin \left(\omega t+ \phi \right) \left[ \sin \left( \omega t + \phi \right) \cos \omega \tau + \cos \left( \omega t + \phi \right) \sin \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin^2 \left(\omega t + \phi \right)  \cos \omega \tau  + \sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\cos \omega \tau \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} + \frac{\int_{-\infty}^{\infty}\sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty}}{2 \omega \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct answer, but the integration in the last step of your derivation is not correct.  The function sin(x)*cos(x) is an odd function (odd*even=odd) and so the integral of this function with limits which are symmetric about zero will be zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function of the 1D harmonic oscillator, solid simulation and liquid simulation were plotted as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 VCAF.png|800px|thumb|center|Graph of VACF against timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a reverse in the velocities of the atoms. In the solid system, the atoms vibrate about their fixed lattice positions and the interactions between neighbouring atoms disrupt this perfect oscillatory motion. Hence, the velocities of the solid system is not perfectly correlated to its initial velocity and the VACF for the solid system follows a damped oscillation. In the liquid system, the liquid atoms are free to move around so any oscillatory motion is rapidly disrupted by the diffusion of the liquid atoms. This results in the VACF for the liquid system to decay much faster to zero than the VACF for the solid system.&amp;lt;ref&amp;gt;The Velocity Autocorrelation Function, http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html. Accessed 22 Feb 2017.&amp;lt;/ref&amp;gt; The harmonic oscillator VACF represents a perfect vibration where there are no interactions to disrupt the oscillatory motion. Its velocity reverses at the end of each oscillation and it does not decay after each oscillation. Therefore, the velocity is always correlated to its initial velocity and its VACF does not decay to zero, unlike the Lennard-Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, collisions between particles randomise particle velocities and cause the VACF to decay.  The liquid does have a small minima before it becomes decorrelated.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF for solid, liquid and gas. The graph of running integral against time is plotted as shown and the diffusion coefficient is estimated using the values of the integral at t = 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.293667 = 0.0979 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.270274 = 0.0901 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 5.230557 = 1.74 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 9.805397 = 3.27 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient of the solid system is approximately zero and increases from liquid to gas. Furthermore, using both VACF and MSD to calculate diffusion coefficients yield similar results, which is expected.&lt;br /&gt;
&lt;br /&gt;
The largest source of error is probably not simulating a large enough amount of time for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; to reach zero. The simulation is only ran until &amp;lt;math&amp;gt;\tau = 10&amp;lt;/math&amp;gt; and it can be seen from the running integral graphs that the integrals for the liquid and gas systems are still increasing. This means that the diffusion coefficients should be larger than my estimates.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, using the trapezium rule for the integration also introduces some error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602786</id>
		<title>Talk:Mod:paxtonchia250893</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602786"/>
		<updated>2017-03-16T05:44:49Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with clearly written answers to all tasks.  You could add a bit more detail to some of your discussions of your own results though and use the theory behind the experiment to support your explanations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
=== Velocity Verlet Algorithm ===&lt;br /&gt;
&lt;br /&gt;
By using the data and formulas given in HO.xls, the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot; were completed. ANALYTICAL was filled in using the formula for the classical harmonic oscillator &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. ERROR was determined by the absolute difference between the ANALYTICAL and the velocity-Verlet solution while ENERGY is calculated by adding up both potential and kinetic energy of the harmonic oscillator. The formula for ENERGY is given by &amp;lt;math&amp;gt;\frac{1}{2}kx^{2} + \frac{1}{2}mv^{2}&amp;lt;/math&amp;gt;. The graphs of the three variables with respect to time are shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 analytical.png|800px|thumb|center|Graph of ANALYTICAL against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 energy.png|800px|thumb|center|Graph of ENERGY against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error.png|800px|thumb|center|Graph of ERROR against Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the default timestep, the positions of the maxima are estimated at t = 2.00, 4.90, 8.00, 11.10 and 14.20. These points are plotted against time and a linear function is fitted to the data as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error maxima.png|800px|thumb|center|Graph of ERROR MAXIMA against Time with fitted linear function]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Different timesteps are experimented and the maximum change in energy is plotted as a percentage against time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 change in energy.png|800px|thumb|center|Graph of Maximum % Change in Energy against Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the above graph, as the timestep increases, the change in energy also increases. Hence, a small timestep (&amp;amp;le;0.200) is required to ensure that the total energy does not change by more than 1% over the course of the simulation. It is important to monitor the total energy of a physical system when modelling its behaviour numerically to ensure that the error in calculating the properties of the system are not large.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good thorough analysis of the timestep, why does the error oscillate?  Energy should be conserved so we need to make sure this is approximately true in our simulations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Single Lennard-Jones Interaction ===&lt;br /&gt;
&lt;br /&gt;
Working with a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt; was substituted into the equation &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; to find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. The results obtained are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} = 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;\sigma^{12} - \sigma^{6}r^6 = 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;r^6 = \sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The force at this separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, can be calculated using the formula &amp;lt;math&amp;gt;F = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r} = 4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;F \left( r_0 \right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12}{\sigma} + \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force, &amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt;, is zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} = 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;-12\sigma^{12} + 6\sigma^{6}r^6 = 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;r^6 = 2\sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well-depth, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;, is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &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;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_2^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2)^{11}} - \frac{1}{5(2)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&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&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2.5}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_{2.5}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2.5)^{11}} - \frac{1}{5(2.5)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{3}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_3^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(3)^{11}} - \frac{1}{5(3)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
To estimate the number of water molecules given a volume under standard conditions, the following equation can be used:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Volume} \times \mathrm{Density}}{\mathrm{Molar}\ \mathrm{mass}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules\ in\ 1mL\ of\ water}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{1 \times 1}{18}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0556 \ \mathrm{mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.35 \times 10^{22} \ \mathrm{molecules}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the equation can be rearranged to find the volume of water given the number of molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Volume}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Number\ of\ water\ molecules} \times \mathrm{Molar}\ \mathrm{mass}}{\mathrm{Density}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Volume\ of\ 10000\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{10000 \times 18}{1 \times 6.022 \times 10^{23}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;2.99 \times 10^{-19} \ \mathrm{mL}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hence, realistic volumes of liquid cannot be simulated and periodic boundary conditions are used. This can be illustrated in the following example. An atom at position &amp;lt;math&amp;gt;(0.5,0.5,0.5)&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;. The atom&#039;s end point before applying the periodic boundary conditions can be found by adding the vector to the atom&#039;s original position, which gives us &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Since the box has the dimensions &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, any value in the end position that is larger than 1 will have 1 subtracted from it after applying the periodic boundary conditions, resulting in &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; as the end point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
By rearranging the equations given,&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;r^* \times \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.2 \times 0.34&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.088 \ \mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac {\epsilon}{k_B}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120 \times 1.380 \times 10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.656 \times 10^{-21} \ \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.997 \ \mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac {T^*\epsilon}{k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;180\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
Generating a random position for each atom to create a simulation box can cause problems in simulations if the atoms are generated close together. This results in a large repulsion between the atoms and may cause the atoms to move too far and out of range in a single timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This can make the simulation crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With a lattice spacing in x,y,z = 1.07722 1.07722 1.07722, the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Since there is one lattice point per unit cell in a simple cubic lattice, the number of lattice points per unit volume (number density) corresponds to &amp;lt;math&amp;gt;\frac {1}{1.25} = 0.8&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice, there are 4 lattice points per unit cell. With a lattice point density of 1.2, the volume of the unit cell is &amp;lt;math&amp;gt;\frac {4}{1.2} = 3.33&amp;lt;/math&amp;gt;. Hence, the length of the unit cell is &amp;lt;math&amp;gt;\sqrt[3]{3.33} = 1.49380&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice was used instead, &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; will be created as there are 4 lattice points per unit cell and the box contains 1000 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Properties of Atoms ===&lt;br /&gt;
&lt;br /&gt;
The purpose of the following commands in the input script are found from the LAMMPS manual&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot;&amp;gt;LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5. Accessed on 17 Feb 2017.&amp;lt;/ref&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&amp;quot; sets the mass for all atoms of type 1 to 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&amp;quot; tells LAMMPS to use the standard 12/6 Lennard-Jones potential between the atoms with a cutoff of 3.0 when calculating the forces. This means that the interaction between a pair of atoms is only calculated if their separation is less than 3.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&amp;quot; sets both the parameters of the Lennard-Jones potential, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, to 1.0 for atom pairs of any type.&lt;br /&gt;
&lt;br /&gt;
If we are specifying the initial position and velocity, we are going to use the velocity verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
The purpose of assigning a value to a text variable (e.g. timestep or n_steps) is for our own convenience. If we need to change the value of the variable, we only need to change the value assigned to the text variable. This only requires us to make a single edit instead of having to change the value every time it is used in the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
The thermodynamics output of the first simulations were analysed to see how long it takes to reach an equilibrium state. Graphs of energy, temperature and pressure against time for the 0.001 timestep experiment are shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro energy.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro temperature.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro pressure.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown above, all three thermodynamic output reached a constant average within the simulation time, which meant that an equilibrium state was reached. From the graph of energy against time, the system reached equilibrium at around t = 0.4.&lt;br /&gt;
&lt;br /&gt;
A single graph of energy against time for all timesteps is plotted as shown:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro all energy.png|1000px|thumb|center|Graph of Energy against Time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 is the largest to give acceptable results as larger timesteps give energies that are higher than that using a timestep of 0.001. Using a timestep of 0.015 is particularly bad because the system did not reach an equilibrium state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy shouldn&#039;t depend on the choice of timestep so all timesteps above 0.0025 are no good.  Choose the largest of the acceptable timesteps - 0.0025 - to allow the simulation to cover as much time as possible.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
=== Thermostats and Barostats ===&lt;br /&gt;
&lt;br /&gt;
Temperature is controlled by multiplying every velocity by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, which can be evaluated as follows, starting from the given equation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{1}{2}\sum_i m_i v_i^2 \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{3}{2} N k_B T \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above line in the input script, &amp;quot;100&amp;quot; means that input values are used every 100 timesteps. &amp;quot;1000&amp;quot; means that 1000 input values are used to calculate the averages. &amp;quot;100000&amp;quot; means that averages are calculated every 100000 timesteps.&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot; /&amp;gt; Values of each variable e.g. temperature will be sampled every 100 timesteps and 1000 measurements contribute to the average. The simulation will run for 100000 timesteps. With a timestep of 0.0025, 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
10 constant pressure/temperature simulations were ran with 5 different temperatures (T = 2, 3, 4, 5, 6) each at 2 different pressures (P = 2, 3). The value of the timestep chosen was 0.0025. Graphs of density against temperature were plotted separately for the 2 pressures. Error bars in both x and y directions and a line corresponding to the density predicted by the ideal gas law were included. As &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; are both 1.0, the ideal gas equation expressed in reduced units is &amp;lt;math&amp;gt;\left( \frac{N}{V} \right) = \frac{P}{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;center&amp;gt;Graph of Density against Temperature at different Pressures&amp;lt;/center&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=2.png|800px|thumb|center|Pressure = 2]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=3.png|800px|thumb|center|Pressure = 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas density for both pressures. This is due to the approximation used in the ideal gas law, where there are no repulsive forces between the particles. However, in the simulation, the atoms are modeled using the Lennard-Jones potential, which accounts for the repulsion between atoms. This causes the atoms in the simulation to be further apart from one another when compared to the ideal gas under the same conditions. Hence, the density of the simulated liquid is lower than the ideal gas.&lt;br /&gt;
&lt;br /&gt;
As pressure increases, the discrepancy increases. This is due to higher pressures causing the atoms to be closer to one another. Hence, the repulsion forces between the atoms in the simulation increases, resulting in larger deviations from the ideal gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, plot results on a single graph to show the trend with pressure more clearly, what about the trend with temperature?  The ideal gas is a good approximation to low density gases, where interparticle interactions are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
10 constant volume/temperature simulations were ran with 5 different temperatures (T = 2.0, 2.2, 2.4, 2.6, 2.8) each at 2 different densities (0.2 and 0.8). A graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; was plotted against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 heatcap.png|800px|thumb|center|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The expected trend is that heat capacity decreases with temperature, which is the trend shown in the graph above. Heat capacity measures the amount of energy required to increase the temperature of the system. As temperature increases, the vibrational energy levels of the system are more accessible and lesser energy will be required to increase the temperature of the system. Hence, heat capacity decreases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a larger density means that there are more atoms per unit volume. Since heat capacity is an extensive property, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; is higher for the simulation with larger density. However, one would expect &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; to be proportional to density but the heat capacity for &amp;lt;math&amp;gt;\rho^* = 0.8&amp;lt;/math&amp;gt; is not 4 times as large as that for &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are simulating a system of spherical particles so there are no vibrational energy levels, but the heat capacity can be related to the density of energy levels (density of states since the system is classical).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An example of my input script is included as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${d}&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;
### 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;
### 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;
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;
###SWITCH OFF THERMOSTAT###&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 vol atoms&lt;br /&gt;
variable dens equal 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 atoms equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_etotal2 v_temp2&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 aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[5]&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*(f_aves[5]-f_aves[4]*f_aves[4])/f_aves[6]&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;Number of atoms: ${atoms}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
The simulations of the Lennard-Jones system were ran for three phases using the values shown in the table below&amp;lt;ref&amp;gt;J. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt; and the RDFs for the three systems are plotted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
!Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Solid&lt;br /&gt;
|1.2&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 rdf.png|800px|thumb|center|RDFs for vapour, liquid and solid phases]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most number of peaks and the peaks are present even at long distances. The liquid phase RDF has a few peaks that are only present at short distances. The vapour phase RDF has only one broad peak and decays the fastest to a constant of one. This is due to the solid phase having long range order where atoms are arranged in a well-defined manner for long distances while the liquid phase only has short range order where nearby atoms are ordered. The vapour phase is the most disordered with no apparent regular arrangement of the atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 fcc.png|thumb|center|Face-centered cubic illustration of nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid phase RDF corresponds to the position of the nearest neighbour, second nearest neighbour and third nearest neighbour respectively. The diagram above shows the positions of these three nearest neighbour with respect to the lattice site in yellow. The lattice site in red is the nearest neighbour, while the lattice site in blue is the second nearest neighbour and the lattice site in green is the third nearest neighbour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intgr.png|800px|thumb|center|Running Integral of RDF for solid phase]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is the distance of the second nearest neighbour, which is 1.475 as shown in the graph above. This also corresponds to the theoretical value calculated [[#Simulation_Box|above]] (1.49380) for a FCC lattice with a lattice point density of 1.2. The coordination number for each of the three peaks can be obtained from the integrals of the peaks as shown above. The coordination number of the first peak is 12. As the graph shows a running integral, the coordination number of the second peak is 17.98 - 12.02 ≈ 6 while the coordination number of the third peak is 42.31 - 17.98 ≈ 24.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice diagram to show which atoms are responsible for the first three peaks, do the coordination numbers that you&#039;ve got from the integral of g(r) make sense based on the fcc structure?  Could you have calculated the lattice parameter from each of the first three peaks separately, by expressing the distances to these atoms in terms of the lattice parameter using the geometry of an fcc lattice, and then calculated an average rather than just giving the value from the second peak?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
Mean squared displacement of solid, liquid and gas simulations as a function of timestep are plotted. The diffusion coefficient is estimated from the gradient of the total MSD against timestep graph.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001019}{0.002} \right) = 0.0849 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001047}{0.002} \right) = 0.0873 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.02006}{0.002} \right) = 1.67 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.036997}{0.002} \right) = 3.08 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trend in the MSD graphs are as expected. The total MSD for the solid simulation stays approximately constant at 0.02 as the solid atoms are fixed in their lattice positions. This is also seen from its negligible diffusion coefficient. The total MSD for both liquid and gas increases linearly with time. However, the total MSD for gas increases much faster than that for liquid, which is also reflected in the larger diffusion coefficient. This is due to the gaseous atoms having weaker intermolecular forces between each other and being able to move more freely than liquid atoms.&lt;br /&gt;
&lt;br /&gt;
For the large system, the trends in the MSD graphs are similar to that for a small system except for the gas phase. For solid and liquid, the MSD graphs and diffusion coefficients are approximately the same in both the large and small system. However, the total MSD for solid showed lesser fluctuations in the large system. On the other hand, the total MSD for gas increases much faster in the large system than the small system, which results in a larger diffusion coefficient as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you divide by 0.002 when you calculate the diffusion coefficient?  Why is the gas MSD curved initially (ballistic motion), before eventually becoming linear?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator is evaluated as followsː&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;A \cos \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{d}x(t)}{\mathrm{d}t} = -A \omega \sin \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} A^2 \omega^2 \sin\left(\omega t+ \phi \right) \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin \left(\omega t+ \phi \right) \left[ \sin \left( \omega t + \phi \right) \cos \omega \tau + \cos \left( \omega t + \phi \right) \sin \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin^2 \left(\omega t + \phi \right)  \cos \omega \tau  + \sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\cos \omega \tau \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} + \frac{\int_{-\infty}^{\infty}\sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty}}{2 \omega \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct answer, but the integration in the last step of your derivation is not correct.  The function sin(x)*cos(x) is an odd function (odd*even=odd) and so the integral of this function with limits which are symmetric about zero will be zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function of the 1D harmonic oscillator, solid simulation and liquid simulation were plotted as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 VCAF.png|800px|thumb|center|Graph of VACF against timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a reverse in the velocities of the atoms. In the solid system, the atoms vibrate about their fixed lattice positions and the interactions between neighbouring atoms disrupt this perfect oscillatory motion. Hence, the velocities of the solid system is not perfectly correlated to its initial velocity and the VACF for the solid system follows a damped oscillation. In the liquid system, the liquid atoms are free to move around so any oscillatory motion is rapidly disrupted by the diffusion of the liquid atoms. This results in the VACF for the liquid system to decay much faster to zero than the VACF for the solid system.&amp;lt;ref&amp;gt;The Velocity Autocorrelation Function, http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html. Accessed 22 Feb 2017.&amp;lt;/ref&amp;gt; The harmonic oscillator VACF represents a perfect vibration where there are no interactions to disrupt the oscillatory motion. Its velocity reverses at the end of each oscillation and it does not decay after each oscillation. Therefore, the velocity is always correlated to its initial velocity and its VACF does not decay to zero, unlike the Lennard-Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, collisions between particles randomise particle velocities and cause the VACF to decay.  The liquid does have a small minima before it becomes decorrelated.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF for solid, liquid and gas. The graph of running integral against time is plotted as shown and the diffusion coefficient is estimated using the values of the integral at t = 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.293667 = 0.0979 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.270274 = 0.0901 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 5.230557 = 1.74 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 9.805397 = 3.27 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient of the solid system is approximately zero and increases from liquid to gas. Furthermore, using both VACF and MSD to calculate diffusion coefficients yield similar results, which is expected.&lt;br /&gt;
&lt;br /&gt;
The largest source of error is probably not simulating a large enough amount of time for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; to reach zero. The simulation is only ran until &amp;lt;math&amp;gt;\tau = 10&amp;lt;/math&amp;gt; and it can be seen from the running integral graphs that the integrals for the liquid and gas systems are still increasing. This means that the diffusion coefficients should be larger than my estimates.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, using the trapezium rule for the integration also introduces some error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602785</id>
		<title>Talk:Mod:paxtonchia250893</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:paxtonchia250893&amp;diff=602785"/>
		<updated>2017-03-16T05:40:44Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with clearly written answers to all tasks.  You could add a bit more detail to some of your discussions of your ow...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with clearly written answers to all tasks.  You could add a bit more detail to some of your discussions of your own results though.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
=== Velocity Verlet Algorithm ===&lt;br /&gt;
&lt;br /&gt;
By using the data and formulas given in HO.xls, the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot; were completed. ANALYTICAL was filled in using the formula for the classical harmonic oscillator &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. ERROR was determined by the absolute difference between the ANALYTICAL and the velocity-Verlet solution while ENERGY is calculated by adding up both potential and kinetic energy of the harmonic oscillator. The formula for ENERGY is given by &amp;lt;math&amp;gt;\frac{1}{2}kx^{2} + \frac{1}{2}mv^{2}&amp;lt;/math&amp;gt;. The graphs of the three variables with respect to time are shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 analytical.png|800px|thumb|center|Graph of ANALYTICAL against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 energy.png|800px|thumb|center|Graph of ENERGY against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error.png|800px|thumb|center|Graph of ERROR against Time]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the default timestep, the positions of the maxima are estimated at t = 2.00, 4.90, 8.00, 11.10 and 14.20. These points are plotted against time and a linear function is fitted to the data as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 error maxima.png|800px|thumb|center|Graph of ERROR MAXIMA against Time with fitted linear function]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Different timesteps are experimented and the maximum change in energy is plotted as a percentage against time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 change in energy.png|800px|thumb|center|Graph of Maximum % Change in Energy against Timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown in the above graph, as the timestep increases, the change in energy also increases. Hence, a small timestep (&amp;amp;le;0.200) is required to ensure that the total energy does not change by more than 1% over the course of the simulation. It is important to monitor the total energy of a physical system when modelling its behaviour numerically to ensure that the error in calculating the properties of the system are not large.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good thorough analysis of the timestep, why does the error oscillate?  Energy should be conserved so we need to make sure this is approximately true in our simulations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Single Lennard-Jones Interaction ===&lt;br /&gt;
&lt;br /&gt;
Working with a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 0&amp;lt;/math&amp;gt; was substituted into the equation &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; to find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. The results obtained are as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} = 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;\sigma^{12} - \sigma^{6}r^6 = 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;r^6 = \sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The force at this separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, can be calculated using the formula &amp;lt;math&amp;gt;F = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r} = 4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;r = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;F \left( r_0 \right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}r}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12}{\sigma} + \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, occurs when the force, &amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt;, is zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} = 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;-12\sigma^{12} + 6\sigma^{6}r^6 = 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;r^6 = 2\sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well-depth, &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;, is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &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;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_2^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2)^{11}} - \frac{1}{5(2)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&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&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{2.5}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_{2.5}^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(2.5)^{11}} - \frac{1}{5(2.5)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\int_{3}^\infty 4\left( \frac{1}{r^{12}} - \frac{1}{r^{6}} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left[ -\frac{1}{11r^{11}} + \frac{1}{5r^{5}} \right]_3^\infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4\left( \frac{1}{11(3)^{11}} - \frac{1}{5(3)^{5}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
To estimate the number of water molecules given a volume under standard conditions, the following equation can be used:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Volume} \times \mathrm{Density}}{\mathrm{Molar}\ \mathrm{mass}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Number\ of\ water\ molecules\ in\ 1mL\ of\ water}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{1 \times 1}{18}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.0556 \ \mathrm{mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.35 \times 10^{22} \ \mathrm{molecules}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Similarly, the equation can be rearranged to find the volume of water given the number of molecules under standard conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\mathrm{Volume}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{Number\ of\ water\ molecules} \times \mathrm{Molar}\ \mathrm{mass}}{\mathrm{Density}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathrm{Volume\ of\ 10000\ water\ molecules}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{10000 \times 18}{1 \times 6.022 \times 10^{23}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;2.99 \times 10^{-19} \ \mathrm{mL}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hence, realistic volumes of liquid cannot be simulated and periodic boundary conditions are used. This can be illustrated in the following example. An atom at position &amp;lt;math&amp;gt;(0.5,0.5,0.5)&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;. The atom&#039;s end point before applying the periodic boundary conditions can be found by adding the vector to the atom&#039;s original position, which gives us &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Since the box has the dimensions &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, any value in the end position that is larger than 1 will have 1 subtracted from it after applying the periodic boundary conditions, resulting in &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; as the end point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
By rearranging the equations given,&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;r^* \times \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.2 \times 0.34&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.088 \ \mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac {\epsilon}{k_B}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;120 \times 1.380 \times 10^{-23}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.656 \times 10^{-21} \ \mathrm{J}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.997 \ \mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac {T^*\epsilon}{k_B}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;1.5 \times 120&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;180\ \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
Generating a random position for each atom to create a simulation box can cause problems in simulations if the atoms are generated close together. This results in a large repulsion between the atoms and may cause the atoms to move too far and out of range in a single timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This can make the simulation crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
With a lattice spacing in x,y,z = 1.07722 1.07722 1.07722, the volume of the unit cell is 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = 1.25. Since there is one lattice point per unit cell in a simple cubic lattice, the number of lattice points per unit volume (number density) corresponds to &amp;lt;math&amp;gt;\frac {1}{1.25} = 0.8&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a face-centred cubic lattice, there are 4 lattice points per unit cell. With a lattice point density of 1.2, the volume of the unit cell is &amp;lt;math&amp;gt;\frac {4}{1.2} = 3.33&amp;lt;/math&amp;gt;. Hence, the length of the unit cell is &amp;lt;math&amp;gt;\sqrt[3]{3.33} = 1.49380&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If a face-centred cubic lattice was used instead, &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; will be created as there are 4 lattice points per unit cell and the box contains 1000 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Properties of Atoms ===&lt;br /&gt;
&lt;br /&gt;
The purpose of the following commands in the input script are found from the LAMMPS manual&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot;&amp;gt;LAMMPS Manual, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5. Accessed on 17 Feb 2017.&amp;lt;/ref&amp;gt; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039;&amp;quot; sets the mass for all atoms of type 1 to 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039;&amp;quot; tells LAMMPS to use the standard 12/6 Lennard-Jones potential between the atoms with a cutoff of 3.0 when calculating the forces. This means that the interaction between a pair of atoms is only calculated if their separation is less than 3.0.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&#039;&#039;&#039;pair_coeff * * 1.0 1.0&#039;&#039;&#039;&amp;quot; sets both the parameters of the Lennard-Jones potential, &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;, to 1.0 for atom pairs of any type.&lt;br /&gt;
&lt;br /&gt;
If we are specifying the initial position and velocity, we are going to use the velocity verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
The purpose of assigning a value to a text variable (e.g. timestep or n_steps) is for our own convenience. If we need to change the value of the variable, we only need to change the value assigned to the text variable. This only requires us to make a single edit instead of having to change the value every time it is used in the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
&lt;br /&gt;
The thermodynamics output of the first simulations were analysed to see how long it takes to reach an equilibrium state. Graphs of energy, temperature and pressure against time for the 0.001 timestep experiment are shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro energy.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro temperature.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro pressure.png|800px|thumb|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As shown above, all three thermodynamic output reached a constant average within the simulation time, which meant that an equilibrium state was reached. From the graph of energy against time, the system reached equilibrium at around t = 0.4.&lt;br /&gt;
&lt;br /&gt;
A single graph of energy against time for all timesteps is plotted as shown:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intro all energy.png|1000px|thumb|center|Graph of Energy against Time for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 is the largest to give acceptable results as larger timesteps give energies that are higher than that using a timestep of 0.001. Using a timestep of 0.015 is particularly bad because the system did not reach an equilibrium state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy shouldn&#039;t depend on the choice of timestep so all timesteps above 0.0025 are no good.  Choose the largest of the acceptable timesteps - 0.0025 - to allow the simulation to cover as much time as possible.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
=== Thermostats and Barostats ===&lt;br /&gt;
&lt;br /&gt;
Temperature is controlled by multiplying every velocity by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, which can be evaluated as follows, starting from the given equation:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{1}{2}\sum_i m_i v_i^2 \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 \left( \frac{3}{2} N k_B T \right) = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the above line in the input script, &amp;quot;100&amp;quot; means that input values are used every 100 timesteps. &amp;quot;1000&amp;quot; means that 1000 input values are used to calculate the averages. &amp;quot;100000&amp;quot; means that averages are calculated every 100000 timesteps.&amp;lt;ref name=&amp;quot;LAMMPS Manual&amp;quot; /&amp;gt; Values of each variable e.g. temperature will be sampled every 100 timesteps and 1000 measurements contribute to the average. The simulation will run for 100000 timesteps. With a timestep of 0.0025, 250 time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
&lt;br /&gt;
10 constant pressure/temperature simulations were ran with 5 different temperatures (T = 2, 3, 4, 5, 6) each at 2 different pressures (P = 2, 3). The value of the timestep chosen was 0.0025. Graphs of density against temperature were plotted separately for the 2 pressures. Error bars in both x and y directions and a line corresponding to the density predicted by the ideal gas law were included. As &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; are both 1.0, the ideal gas equation expressed in reduced units is &amp;lt;math&amp;gt;\left( \frac{N}{V} \right) = \frac{P}{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;center&amp;gt;Graph of Density against Temperature at different Pressures&amp;lt;/center&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=2.png|800px|thumb|center|Pressure = 2]]&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 npt p=3.png|800px|thumb|center|Pressure = 3]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the ideal gas density for both pressures. This is due to the approximation used in the ideal gas law, where there are no repulsive forces between the particles. However, in the simulation, the atoms are modeled using the Lennard-Jones potential, which accounts for the repulsion between atoms. This causes the atoms in the simulation to be further apart from one another when compared to the ideal gas under the same conditions. Hence, the density of the simulated liquid is lower than the ideal gas.&lt;br /&gt;
&lt;br /&gt;
As pressure increases, the discrepancy increases. This is due to higher pressures causing the atoms to be closer to one another. Hence, the repulsion forces between the atoms in the simulation increases, resulting in larger deviations from the ideal gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, plot results on a single graph to show the trend with pressure more clearly, what about the trend with temperature?  The ideal gas is a good approximation to low density gases, where interparticle interactions are less significant.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&lt;br /&gt;
10 constant volume/temperature simulations were ran with 5 different temperatures (T = 2.0, 2.2, 2.4, 2.6, 2.8) each at 2 different densities (0.2 and 0.8). A graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; was plotted against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 heatcap.png|800px|thumb|center|Graph of &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; against &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The expected trend is that heat capacity decreases with temperature, which is the trend shown in the graph above. Heat capacity measures the amount of energy required to increase the temperature of the system. As temperature increases, the vibrational energy levels of the system are more accessible and lesser energy will be required to increase the temperature of the system. Hence, heat capacity decreases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a larger density means that there are more atoms per unit volume. Since heat capacity is an extensive property, &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; is higher for the simulation with larger density. However, one would expect &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; to be proportional to density but the heat capacity for &amp;lt;math&amp;gt;\rho^* = 0.8&amp;lt;/math&amp;gt; is not 4 times as large as that for &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You are simulating a system of spherical particles so there are no vibrational energy levels, but the heat capacity can be related to the density of energy levels (density of states since the system is classical).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An example of my input script is included as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${d}&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;
### 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;
### 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;
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;
###SWITCH OFF THERMOSTAT###&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 vol atoms&lt;br /&gt;
variable dens equal 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 atoms equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_etotal2 v_temp2&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 aveetotal equal f_aves[4]&lt;br /&gt;
variable aveetotal2 equal f_aves[5]&lt;br /&gt;
variable heatcap equal ${atoms}*${atoms}*(f_aves[5]-f_aves[4]*f_aves[4])/f_aves[6]&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;Number of atoms: ${atoms}&amp;quot;&lt;br /&gt;
print &amp;quot;Volume: ${vol}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy: ${aveetotal}&amp;quot;&lt;br /&gt;
print &amp;quot;Energy2: ${aveetotal2}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&lt;br /&gt;
The simulations of the Lennard-Jones system were ran for three phases using the values shown in the table below&amp;lt;ref&amp;gt;J. Hansen and L. Verlet, Phase Transitions of the Lennard-Jones System, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;1969&#039;&#039;&#039;, &#039;&#039;184&#039;&#039;, 151.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt; and the RDFs for the three systems are plotted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
!Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
!Solid&lt;br /&gt;
|1.2&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 rdf.png|800px|thumb|center|RDFs for vapour, liquid and solid phases]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The solid phase RDF has the most number of peaks and the peaks are present even at long distances. The liquid phase RDF has a few peaks that are only present at short distances. The vapour phase RDF has only one broad peak and decays the fastest to a constant of one. This is due to the solid phase having long range order where atoms are arranged in a well-defined manner for long distances while the liquid phase only has short range order where nearby atoms are ordered. The vapour phase is the most disordered with no apparent regular arrangement of the atoms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 fcc.png|thumb|center|Face-centered cubic illustration of nearest neighbours]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid phase RDF corresponds to the position of the nearest neighbour, second nearest neighbour and third nearest neighbour respectively. The diagram above shows the positions of these three nearest neighbour with respect to the lattice site in yellow. The lattice site in red is the nearest neighbour, while the lattice site in blue is the second nearest neighbour and the lattice site in green is the third nearest neighbour.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 intgr.png|800px|thumb|center|Running Integral of RDF for solid phase]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is the distance of the second nearest neighbour, which is 1.475 as shown in the graph above. This also corresponds to the theoretical value calculated [[#Simulation_Box|above]] (1.49380) for a FCC lattice with a lattice point density of 1.2. The coordination number for each of the three peaks can be obtained from the integrals of the peaks as shown above. The coordination number of the first peak is 12. As the graph shows a running integral, the coordination number of the second peak is 17.98 - 12.02 ≈ 6 while the coordination number of the third peak is 42.31 - 17.98 ≈ 24.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice diagram to show which atoms are responsible for the first three peaks, do the coordination numbers that you&#039;ve got from the integral of g(r) make sense based on the fcc structure?  Could you have calculated the lattice parameter from each of the first three peaks separately, by expressing the distances to these atoms in terms of the lattice parameter using the geometry of an fcc lattice, and then calculated an average rather than just giving the value from the second peak?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
Mean squared displacement of solid, liquid and gas simulations as a function of timestep are plotted. The diffusion coefficient is estimated from the gradient of the total MSD against timestep graph.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Total MSD against Timestep for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001019}{0.002} \right) = 0.0849 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.001047}{0.002} \right) = 0.0873 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 Dvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.02006}{0.002} \right) = 1.67 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 Dvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{6} \left( \frac{0.036997}{0.002} \right) = 3.08 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The trend in the MSD graphs are as expected. The total MSD for the solid simulation stays approximately constant at 0.02 as the solid atoms are fixed in their lattice positions. This is also seen from its negligible diffusion coefficient. The total MSD for both liquid and gas increases linearly with time. However, the total MSD for gas increases much faster than that for liquid, which is also reflected in the larger diffusion coefficient. This is due to the gaseous atoms having weaker intermolecular forces between each other and being able to move more freely than liquid atoms.&lt;br /&gt;
&lt;br /&gt;
For the large system, the trends in the MSD graphs are similar to that for a small system except for the gas phase. For solid and liquid, the MSD graphs and diffusion coefficients are approximately the same in both the large and small system. However, the total MSD for solid showed lesser fluctuations in the large system. On the other hand, the total MSD for gas increases much faster in the large system than the small system, which results in a larger diffusion coefficient as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you divide by 0.002 when you calculate the diffusion coefficient?  Why does is the gas MSD curved initially (ballistic motion), before eventually becoming linear?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator is evaluated as followsː&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;A \cos \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\mathrm{d}x(t)}{\mathrm{d}t} = -A \omega \sin \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: right;&amp;quot; | &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} A^2 \omega^2 \sin\left(\omega t+ \phi \right) \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin \left(\omega t+ \phi \right) \left[ \sin \left( \omega t + \phi \right) \cos \omega \tau + \cos \left( \omega t + \phi \right) \sin \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} \sin^2 \left(\omega t + \phi \right)  \cos \omega \tau  + \sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\frac{\cos \omega \tau \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} + \frac{\int_{-\infty}^{\infty}\sin \left(\omega t + \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \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;
|&amp;lt;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau + \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty}}{2 \omega \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;br&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
||| &amp;lt;math&amp;gt;=&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;\cos \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct answer, but the integration in the last step of your derivation is not correct.  The function sin(x)*cos(x) is an odd function (odd*even=odd) and so the integral of this function with limits which are symmetric about zero will be zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function of the 1D harmonic oscillator, solid simulation and liquid simulation were plotted as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:pwc14 VCAF.png|800px|thumb|center|Graph of VACF against timestep]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a reverse in the velocities of the atoms. In the solid system, the atoms vibrate about their fixed lattice positions and the interactions between neighbouring atoms disrupt this perfect oscillatory motion. Hence, the velocities of the solid system is not perfectly correlated to its initial velocity and the VACF for the solid system follows a damped oscillation. In the liquid system, the liquid atoms are free to move around so any oscillatory motion is rapidly disrupted by the diffusion of the liquid atoms. This results in the VACF for the liquid system to decay much faster to zero than the VACF for the solid system.&amp;lt;ref&amp;gt;The Velocity Autocorrelation Function, http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html. Accessed 22 Feb 2017.&amp;lt;/ref&amp;gt; The harmonic oscillator VACF represents a perfect vibration where there are no interactions to disrupt the oscillatory motion. Its velocity reverses at the end of each oscillation and it does not decay after each oscillation. Therefore, the velocity is always correlated to its initial velocity and its VACF does not decay to zero, unlike the Lennard-Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, collisions between particles randomise particle velocities and cause the VACF to decay.  The liquid does have a small minima before it becomes decorrelated.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to approximate the integral under the VACF for solid, liquid and gas. The graph of running integral against time is plotted as shown and the diffusion coefficient is estimated using the values of the integral at t = 10.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for small systems&#039;&#039;&#039;&lt;br /&gt;
! &#039;&#039;&#039;Graph of Running Integral against Time for large systems&#039;&#039;&#039; &lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafsolsmall.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafsollarge.png|550px|thumb|center|Solid Simulation. &amp;lt;math&amp;gt;D \approx 0&amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafliqsmall.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.293667 = 0.0979 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafliqlarge.png|550px|thumb|center|Liquid Simulation.  &amp;lt;math&amp;gt;D = \frac{1}{3} \times 0.270274 = 0.0901 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Pwc14 vcafvapsmall.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 5.230557 = 1.74 &amp;lt;/math&amp;gt;]] || [[File:Pwc14 vcafvaplarge.png|550px|thumb|center|Gas Simulation. &amp;lt;math&amp;gt;D = \frac{1}{3} \times 9.805397 = 3.27 &amp;lt;/math&amp;gt;]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient of the solid system is approximately zero and increases from liquid to gas. Furthermore, using both VACF and MSD to calculate diffusion coefficients yield similar results, which is expected.&lt;br /&gt;
&lt;br /&gt;
The largest source of error is probably not simulating a large enough amount of time for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; to reach zero. The simulation is only ran until &amp;lt;math&amp;gt;\tau = 10&amp;lt;/math&amp;gt; and it can be seen from the running integral graphs that the integrals for the liquid and gas systems are still increasing. This means that the diffusion coefficients should be larger than my estimates.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, using the trapezium rule for the integration also introduces some error.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:csw114liquidsim&amp;diff=601157</id>
		<title>Talk:Mod:csw114liquidsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:csw114liquidsim&amp;diff=601157"/>
		<updated>2017-03-12T14:42:10Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with all tasks answered and results well presented.  Make sure you fully understand the background theory behind each task though so that you know exactly what the task is asking you and why.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular reaction dynamics==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this section of the experiment,the Veloctiy-Verlet algorithm was used to model the behaviour of a classical harmonic oscillator.&lt;br /&gt;
From the data provided in the HO.xls files,the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot; were completed. &lt;br /&gt;
The graphs below plots 1) displacement,2) total enery 3) absolute error between the classical and Verlet-Velocity derived solutions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Displacement vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Error vs Time&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Displacement Vs Time (0.1TS).png|center |500x400px |Displacement Vs Time]] &lt;br /&gt;
|[[File:Energy vs Time (0.1 TS).png|center |500x400px |Energy vs Time]] &lt;br /&gt;
|[[File:Error vs Time (0.1TS).png|center |500x400px |Error vs Time]] &lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of a classical  harmonic oscillator  was obtained by summing its potential and kinetic energy, according to the equation:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \text{Total Energy}  = U + K&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Total Energy}  = \frac{1}{2}kx^2  + \frac{1}{2}mv^2&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs shown above, we can see that displacement and energy display an oscillating behaviour while the error between the  classical and Verlet-Velocity derived solutions increases over time &amp;lt;br&amp;gt;&lt;br /&gt;
The position of the maxima in the error column were found and plotted as a function against time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Several different timesteps were experimented with to observe its effects on the harmonic oscilator.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Error&lt;br /&gt;
|-&lt;br /&gt;
|0.15&lt;br /&gt;
|[[File:Energy vs TIme (0.15 TS).png|center |400x500px |Energy Vs Time (0.15 Timestep)]] &lt;br /&gt;
|[[File:Error Vs Time (0.15 TS).png |center |400x500px|Error Vs Time (0.15 Timestep)]]&lt;br /&gt;
|-&lt;br /&gt;
|0.20&lt;br /&gt;
|[[File:Energy vs time (0.2TS).png|center |400x500px|Energy Vs Time (0.20 Timestep)]]&lt;br /&gt;
|[[File:Error vs time (0.2TS).png|center |400x500px |Error Vs Time (0.20 Timestep]] &lt;br /&gt;
|-&lt;br /&gt;
|0.30&lt;br /&gt;
|[[File:Energy vs TIme (0.3TS).png|center |400x500px |Energy Vs Time (0.30 Timestep)]]&lt;br /&gt;
|[[File:Error vs Time (0.3TS).png|center |400x500px |Error Vs Time (0.30Timestep]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the plots above, we can see that increasing the timestep for each simulation has the effect of increasing the amplitude and frequency of the oscillator. &lt;br /&gt;
The error also increases as the timestep increases. This is because data is sampled at a less frequent rate, increasing the margin for error in the system as a result. &lt;br /&gt;
We must monitor the total energy of a system to ensure that is obeying the law of energy conservation. By monitoring the total energy, we can monitor the equilibration process of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Did you decide which timestep gives you a variation in energy of less than 1? Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When modelling simple fluid systems, the Lennard Jones Potential is suitable to describe the interactions of atom pairs to a high degree of accuracy.&lt;br /&gt;
The separation distance when potential energy = 0 occurs when &amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;. The force experienced at this distance is equivalent to &amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}&amp;lt;/math&amp;gt;(Workings shown in the table below)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Separation distance &amp;lt;math&amp;gt; r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Force &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} =\frac{\sigma^{6}}{r^{6}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_i}4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{r}\left ( \frac{\sigma}{r} \right )^6 \left \lbrack\left ( \frac{\sigma}{r} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{r}\left ( \frac{\sigma}{r} \right )^6 \left \lbrack\left ( \frac{\sigma}{r} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}\left ( \frac{\sigma}{\sigma} \right )^6 \left \lbrack\left ( \frac{\sigma}{\sigma} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;&#039;&#039;&#039; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium separation, the attractive and repulsive forces balances out each other. This occurs when &amp;lt;math&amp;gt; F = 0&amp;lt;/math&amp;gt;. The equilibrium separation occurs at &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;. The well depth at this separation was evaluated to be  &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;. (Working shown below)&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Separation &lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Well Depth&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_i}4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;-12\sigma^{12} + 6\sigma^{6}r^6 = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r^6 = 2\sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -\epsilon&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&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;&#039;&#039;&#039;.&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard Jones potential curve was evaluated for 3 sets of limits, each representing different seperation distances between two atoms. &lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | &amp;lt;math&amp;gt;2\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |&amp;lt;math&amp;gt;2.5\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |&amp;lt;math&amp;gt;3\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({2\sigma}) ^{11}} + \frac{\sigma^6}{5({2\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({2}) ^{11}} + \frac{1}{5({2}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 0.024822 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248 \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({2.5\sigma}) ^{11}} + \frac{\sigma^6}{5({2.5\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({2.5}) ^{11}} + \frac{1}{5({2.5}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 8.1767\times10^{-3} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx - 8.177\times10^{-3} \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({3\sigma}) ^{11}} + \frac{\sigma^6}{5({3\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({3}) ^{11}} + \frac{1}{5({3}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 3.290\times10^{-3} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx - 3.290\times10^{-3} \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Modelling realistic volumes of liquids===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The number of water molecules in 1 mL of water under standard conditions were estimated.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Estimating number of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O molecules in 1 mL&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;At 298K &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho_{{H_2}O} = 1 g mol^{-1} \approx  \text{1 g}  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Number of mols} = \frac{1}{18.0} \approx \text{0.555 mols}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}= 0.0555 \times6.023 \times10^{23} =  3.346 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}=3.346 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}\approx3.35 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules were evaluated as shown below:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Estimating volume of 10000 H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O molecules&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Volume of 10000 molecules} = 10000 \times \frac{1}{3.346\times 10^{23}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{V}= 2.9885\times10^{-19} \text{mL} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{V}\approx 2.99\times10^{-19}  \text{mL}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There should be 3x10^22 molecules of water in 1 ml, you are just out by a factor of 10, check your working. Volume of 10000 molecules is correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary  Function===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implementing a Periodic boundary function implies that when a particle interacts  across a specified boundary , they can exit one end of the box and re-enter the other end. This enables the total number of particles in a box to stay constant. With the example shown below. The particle travels along a vector which would cause it to exit the box. However, instead of moving to the &amp;quot;next simulation box&amp;quot;, the periodic boundary function stipulates that it &amp;quot;re-enters&amp;quot; the same simulated box via the opposite side, as demonstrated with its final  position vector.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Position Vector&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Position Vector before periodic boundary function = (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Position Vector After periodic boundary function  = (0.2, 0.1, 0.7)&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Estimating Real Parameters for an Argon Atom===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When working with the Lennard Jones potential, &amp;quot;reduced units&amp;quot; are often used to simplify mathematical calculations.  Scaling factors are applied to experimental quantities to make expressions less cumbersome. In the exercise below, the real parameters for an Argon atom were calculated based on the reduced units provided.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Distance&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Force&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{r^*}= \frac{r}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{r} = 3.2\times 0.34nm &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{r} =1.08 nm&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{since}\frac{\epsilon}{k_B}=120K&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon =120K\times k_B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E = E* \times 120K \times k_B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E =0.9974  \text{kJ  mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E \approx 0.9974 \text{kJ  mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= \frac{\epsilon}{k_B}\times\frac{1}{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= 120\times\frac{1}{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= \frac{1}{180}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;T= 180k&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibrium==&lt;br /&gt;
===Defining positions of atoms===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? &#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Giving atoms a random staring position would only introduce computational errors if the two atoms end up on the same starting position. This would affect the pairwise atomic interactions calculated by the Lennard Jones potential. If the atoms are superimposed on top of each other, it would imply a separation distance of 0, causing its potential to tend to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt;. This would introduce errors when defining properties such as mass or velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: If particles start too close together the high repulsion forces can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Creating a simulation box===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. &amp;lt;br&amp;gt;Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The  simulation box used in this section of the experiment, has a lattice density of 0.8. &amp;lt;br&amp;gt;&lt;br /&gt;
For a primative lattice structure with one atom per unit cell&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{\text{Number  of  lattice  points}}{\mathrm{Volume}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{1}{\left(1.07722\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=0.79999&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho\approx 0.8&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a FCC  lattice with 4 atoms per unit cell and a number density of 1.2, the length of the unit cell was approximately 1.493. (Workings shown below)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{\text{Number  of  lattice  points}}{\left(\text{Length}\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{1}{\left(1.07722\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\left(Length\right)^3=\frac{10}{3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Length=1.49380&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Length\approx 1.493 \left(3 dp \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
If a FCC lattice was used , 4000 atoms will be created as there are 4 lattice points per unit cell and the  simulation box contains 1000 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Setting properties of atoms===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code  used in simulations is related to the physical interactions between atoms.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 80%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Purpose&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;mass 1 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Defines the mass for all atoms of one or more atom type.&amp;lt;br&amp;gt;&lt;br /&gt;
Each atom is associated with a specific mass. &amp;lt;br&amp;gt;&lt;br /&gt;
In this simulation, atoms of type 1 are assigned a mass of 1.0. &amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;pair_style lj/cut 3.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
It calculates the pairwise interactions between atoms using the Lennard-Jones potential. &amp;lt;br&amp;gt;&lt;br /&gt;
This line of code also defines an Rc term which  specifies the global cutoff value for calculation of the potential at a distance of 3.0.&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;This line of code calculates the force field coefficients in the Lennard Jones Potential.&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;quot;wildcard&amp;quot; asterisk is able to set coefficients for all pairs of atom interactions within the system.&amp;lt;br&amp;gt;&lt;br /&gt;
In this simulation the codes sets the force field constants for all pair wise interactions at 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard Jones potential?  Why do we use a cutoff for the potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
We are able to use the Velocity-verlet alogritym as we have defined &amp;lt;math&amp;gt; x_i \left( 0 \right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i \left( 0 \right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the first code below. what do you think the purpose of these lines is? Why not just write (second code)?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | First code&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Second code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;br&amp;gt;&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes shown in the boxes can be  used when running simulations of a system.&lt;br /&gt;
Using the code in the first box allows us to vary the timestep of the simulation while running it for the same amount of time. &lt;br /&gt;
It calculates the number of steps needed for the simulation to be ran within a fixed time.&lt;br /&gt;
Although the number of steps taken will vary with timeset but it is within a fixed time frame.&amp;lt;br&amp;gt;&lt;br /&gt;
The code in the second box  will also allow us to vary the timestep but under slightly different conditions. This code  would change the run time of the simulation and does not calculate the number of steps needed to be taken to run the simulation for a fixed time frame.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Both pieces of code will run the same simulation, but the advantage of using variables as in the first case is that if we change the timestep, all properties which depend on the value of the timestep are also changed automatically.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The thermodynamics output of the &amp;quot;melt crystal&amp;quot; simulations  were analysed. &lt;br /&gt;
The simulation was ran at a timestep of 0.01.Graphs of energy, temperature and pressure against times are plotted and shown below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total Energy vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Temperature vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Pressure vs Time&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Total_energy_vs_time_(3).png|350x250px|Total Energy vs Time]]&lt;br /&gt;
|[[File:Temperature_vs_Time_(3).png|350x250px|Temperature vs Time]]&lt;br /&gt;
|[[File:Pressure_vs_Time_(3).png|350x250px|Pressure vs Time ]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs, we see see that the system reaches equilibrium as the output can be seen fluctuating around a constant value. It can be seen that the system reaches equilibrium around 0.3 to 0.4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Several simulations were ran at different time steps, a plot of total energy of each system vs time is shown in the graph below&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total energy vs Time (At different timesteps)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Time_vs_Energy_ALl_timestep_(3).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
As the time step decreases, the total number of steps taken in the simulation increases.&lt;br /&gt;
From the data, we can see that total energy for a timestep =0.015, increases with time and diverges. The system has not reached equilibrium and will not provide useful information can be gathered.It breaking the law of conservation of mass and is an indication that there are errors within the simulation. &amp;lt;br&amp;gt;&lt;br /&gt;
With the 4 other timesteps chosen, it can be seen that total energy decreases over time and slowly begins to fluctuation around an equilibrium value. &amp;lt;br&amp;gt;&lt;br /&gt;
With a smaller timestep chosen the accuracy of calculations increase. This would imply that among the 5 simulations ran, a timestep of 0.001 would provide the most accurate physical data regarding our system under consideration. However, it would be computationally very expensive. On the other hand a timestep of 0.0025 would provide a good balance, providing accuracy whilst giving us a reasonable time to monitor the system. The data obtained at a timestep of 0.0025 shows that it provides comparable output data in relation to a timestep of 0.001.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The largest timestep doesn&#039;t conserve energy, but mass is unaffected by the timestep.  The average total energy should not depend on the choice of timestep, as it does for 0.01 and 0.0075, so the best choice is 0.0025.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;.Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The temperature of the system can be controlled by multiplying it with a constant factor  &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
In the calculations below, a value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; has been calculated to ensure that  the instantaneous temperature (T) is equivalent to the target temperature  &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;br&amp;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;&amp;lt;br&amp;gt;&lt;br /&gt;
Multiplying every velocity by gamma&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(v_i*\gamma\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2\gamma^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {\frac{3}{2} N k_B \mathfrak{T}}  {\frac{1}{2}\sum_i m_i v_i^2T} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma =\pm\sqrt{ \frac {\mathfrak{T}}{T} }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, gamma is the positive root as we don&#039;t want to change the direction of the particles velocity, just scale the magnitude of the velocity.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following lines of code were used to run the simulation.&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height:50px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Input code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first value 100 stipulates that the simulation will calculate average thermodynamic data with a space of every 100 timesteps.  The second value 1000 causes the simulation to use 1000 data points to calculate the thermodynamic values. The third value,10,000, refers to the total number of timesteps to be used in the simulation.&lt;br /&gt;
With a timestep of 0.0025 and 10000 steps will result in a simulation time of 250.&lt;br /&gt;
&lt;br /&gt;
===Equation of State===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;:  Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Variable&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Values&lt;br /&gt;
|-&lt;br /&gt;
|Pressure&lt;br /&gt;
|2.45 , 2.75&lt;br /&gt;
|-&lt;br /&gt;
|Temperature&lt;br /&gt;
|1.6, 1.8, 2.0, 2.2, 2.4 &lt;br /&gt;
|-&lt;br /&gt;
|Timestep&lt;br /&gt;
|0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
In this section of the experiment, the isobaric-isothermal ensemble is used to calculate the equation of state&lt;br /&gt;
This produced a set of 10 data points which are plotted in the graph shown below.&lt;br /&gt;
The ideal gas equation was also used to &#039;predict&#039; the density at each given temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Pressure =  2.75&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Pressure = 2.45&lt;br /&gt;
|-&lt;br /&gt;
|[[File:DEnsity 2.75 vs Temp(4).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|[[File:Density vs Temp (4).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
We can see that the ideal gas law predicts a higher density value compared to calculated values as it does not take into account inter-atomic interactions. The ideal gas law treats atoms as randomly moving points without any volume.  It assumes that there are no repulsive interactions between atoms. Atoms would be closer together in comparison to the Lennard Jones potential model as they are not repelling each other. This leads to a higher calculated density  as there are more atoms per unit area (in the ideal gas model).&amp;lt;br&amp;gt;&lt;br /&gt;
On the other hand, the calculated densities are derived using the Lennard Jones potential and takes into account attractive and repulsive forces between atoms, resulting in deviations between the predicted and calculated densities.  The ideal gas equation is only useful for modelling real fluidic systems at low densities where there are minimal atom interactions. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how does the discrepancy between the ideal gas and simulation results change with pressure and temperature?  Plot all of the data on one graph to see the trends more clearly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities using statistical physics==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity refers to the amount of energy needed to raise the temperature of a system by 1k.&amp;lt;br&amp;gt;&lt;br /&gt;
In this section, the heat capacities were plotted as a function of time to produce a total of 10 data points as shown in the graph below. The simulation conditions used are shown in the table on the right&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Variable&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Values&lt;br /&gt;
|-&lt;br /&gt;
|Density&lt;br /&gt;
|0.2,0.8&lt;br /&gt;
|-&lt;br /&gt;
|Temperature&lt;br /&gt;
|2.0, 2.2, 2.4, 2.6, 2.8 &lt;br /&gt;
|-&lt;br /&gt;
|Atoms&lt;br /&gt;
|3375&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total energy vs Time (At different timesteps)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Heat cap vs Temp (5).png|650x550px|Heat capacity vs VTemp]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graph, we can see that increasing the temperature leads to a decrease in heat capacity. &lt;br /&gt;
As the temperature of the system increases, it is possible to excite the particles to a higher energy level. However, as the higher energy states become increasingly populated, it becomes harder for the system to absorb more energy, thus leading to a lower specific heat capacity&amp;lt;br&amp;gt;&lt;br /&gt;
From the graph, we can also see that density is proportional to heat capacity.  Increasing the density of a system increases the number of atoms per unit cell. This increases the number of accessible mirco-states. The system is able to absorb more energy per unit cell, thus leading to a higher heat capacity. This also shows that  heat capacity is an extensive property.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be inferred that the system has a finite number of energy levels as the heat capacity has not reached a constant value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Remember that your simulations are classical so there are no discrete energy levels.  Why did you choose to fit your data with the line shown in the graph?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Input code===&lt;br /&gt;
The following input code was used to calculate the heat capacity&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Input code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;#### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&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.6&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp atoms vol density&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable N equal atom&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable density equal density&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp v_temp2 v_density&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable T2 equal f_aves[4]&lt;br /&gt;
variable tempave equal f_aves[3]&lt;br /&gt;
variable E2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable EE equal f_aves[2]&lt;br /&gt;
variable top equal ${EE}-${E2}&lt;br /&gt;
variable heatcap equal (${top}/${T2})*${N2}&lt;br /&gt;
variable heatcapvol equal ${heatcap}/vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Here are the results from this calculation!! &amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${tempave}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacty/Vol: ${heatcapvol}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacty: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r) \text{ and } \int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Phase&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Temperature&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Density&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1.2&lt;br /&gt;
|1.1&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.2&lt;br /&gt;
|0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1.2&lt;br /&gt;
|0.1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Data on the  structure of the Lenard Jones   system can be characterised by its radial distribution function. &lt;br /&gt;
In this section of the experiment, the radial distribution functions &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; were calculated for the solid, liquid, and vapour phases . Plots of  &amp;lt;math&amp;gt;g(r) \text{ and } \int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
are shown below. Simulation conditions are provided on the right. A timestep of 0.002 was used to perform this set of simulations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | &amp;lt;math&amp;gt;g\left(r\right)&amp;lt;/math&amp;gt; vs distance&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |  &amp;lt;math&amp;gt;\int g\left(r\right)&amp;lt;/math&amp;gt; vs distance&lt;br /&gt;
|-&lt;br /&gt;
|[[File:RDF Graph 2 (6).png|550x450px|RDF integral]]&lt;br /&gt;
|[[File:RDF Graph (6).png|550x450px|RDF integral]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A peak indicates a favoured separation distance for the neighbours from a reference atom.&lt;br /&gt;
The number of peaks in each radial distribution function decreases in the following manner : Solid&amp;gt; Liquid &amp;gt;Gas.  &lt;br /&gt;
*Gas Phase&lt;br /&gt;
The rdf of the Gas phase shows one main peak before it decays to a value of one as the distance r increases. Structurally, the  Gaseous phase lacks a regular structure thus heavily influencing its rdf. It also suggest that it only has one coordination sphere surrounding the reference atom. The peak present for the gaseous states is significantly broadened possibly due to the thermal motion of the atoms. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Liquid Phase&lt;br /&gt;
The rdf of the liquid phase shows a fewer number of peaks compared to the solid phase.  This is because there is local ordering within the liquid phase but no long range order. The first peak in the rdf is the highest, indicating that the reference atom experiences the strongst attractive and repulsive interactions with its nearest neighbour. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Solid Phase&lt;br /&gt;
The rdf of the Solid phase shows multiple peaks even as the distance increases. This is because Solids display long range order where atoms are arranged in a orderly manner.  Each peak on the rdf of the solid phase corresponds to the atoms &#039;nearest neighbour, with the first peak corresponding to the first  nearest neighbours, second peak corresponding to the  second nearest neighbour etc.&amp;lt;br&amp;gt;&lt;br /&gt;
For a face centered cubic lattice, with a lattice parameter &amp;quot;a&amp;quot; and  unit cell length of 1.49380, the distance of its neighbours were calculated and compared to experimental values as shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Peak Number&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Lattice Spacing (Theoratical)&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Lattice Spacing (Calculations)&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
|1 (Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sqrt{2}}{2}a= = 1.06 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.025&lt;br /&gt;
|12&lt;br /&gt;
|-&lt;br /&gt;
|2 (Second Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt;a = 1.49 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.457&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|3 (Third Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{\sqrt{6}}{2}a = 1.83 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.825&lt;br /&gt;
|24&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
A zoomed in version of the radial distribution function for the solid simulation is shown below. The distances between the reference atom and its 3 nearest neighbors are indicated on the graph.&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Radial Distribution Function Solid Phase&lt;br /&gt;
|-&lt;br /&gt;
|[[File:RDF solid phase zoom (6).png|550x450px|RDF integral]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good description of the solid, liquid and gas RDFs.  The lattice spacing is the width of the unit cell, not the distance to the first nearest neighbour in an fcc lattice, what do the results in your table show? How did you calculate the coordination numbers for the first three peaks? Showing the atoms responsible for these peaks on a diagram of an fcc lattice would have been good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;TASK: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mean squared displacements of small and large systems were studied for the solid, liquid and gaseous phase. This was plotted as a function against time and shown below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Mean Squared Displacement (Total) - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Mean Squared Displacement (Total) -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|[[File:MSD Solid (7).png|450x350px|MSD Solid Small]]&lt;br /&gt;
|[[File:MSD Solid Large system (7).png|450x350px|MSD Solid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|[[File:MSD Liquid (7).png|460x350px|MSD Liquid Small]]&lt;br /&gt;
|[[File:MSD Liquid Large System (7).png|450x350px|MSD Liquid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|[[File:MSD Gas (7).png|450x360px|MSD Gas Small]]&lt;br /&gt;
|[[File:MSD Gas Large System (7).png|450x350px|MSD Gas Large]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the graphs showing Mean Squared Distance against timestep, the diffusion coefficient for each system can be estimated using the following equation &lt;br /&gt;
&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.The diffusion coefficients were estimated for each system and shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficent - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficient -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times \frac{4.0226-1.97381}{2000\times0.002}=0.085&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{4.1237-2.00809}{2000\times0.002}=0.0820&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{64.2573-25.760}{2000\times0.002}=1.60&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{105.541-36.398}{2000\times0.002}=2.88&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the table, we can see that the diffusion coefficient increases in the following order:  Solid , Liquid. Gas. &amp;lt;br&amp;gt;&lt;br /&gt;
The diffusion coefficient of the solid phase is negligible as the atoms are held in fixed positions. &lt;br /&gt;
The diffusion coefficients for the Liquid and Gaseous phases  increase with time. In these two phases, the atoms are no longer held in fixed positions and have greater molecular motion. The gaseous phase shows a higher diffusion coefficient compared to the liquid phase. This is due to the difference in densities between the two states. In the gaseous phase, molecules have a greater mean free path and can travel a further distance before colliding with another molecule.&lt;br /&gt;
Moreover, atoms in the gaseous phase experience weaker intermolecular forces and are able to move with a greater degree of freedom.&lt;br /&gt;
&lt;br /&gt;
The simulation was also repeated for large systems containing one million atoms and the results are similar to the results obtained from simulations of small systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: To calculate D you should only fit a straight line to the linear part of the MSD graph as this is the diffusive regime, not the whole data set.  Why is the gas MSD graph curved at short times?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator &#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator is evaluated.&amp;lt;br&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | VACF of the 1D Harmonic Oscilator.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \text{ Since }  x(t) = A\cos\left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{\mathrm{d}x(t)}{\mathrm{d}t} = -A \omega \sin \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -\omega A\sin\left(\omega t + \phi\right) \times -\omega A\sin\left(\omega (t + \tau) + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \omega^{2} A^{2}\sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty}\sin\left(\omega t + \phi\right) \times \sin\left(\omega t + \tau + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Using the identity} \sin\left(A +B\right) = \sin\left(A \right)\cos\left(B\right) + \sin\left(A \right)\cos\left(B \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Where }(\omega t + \phi) = \text{ and }\omega \tau = B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \times \sin\left(\omega t + \phi \right)\cos\left(\omega \tau\right)\mathrm{d}t + \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}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\cos\left(\omega \tau\right) \text{ and } \sin\left(\omega \tau\right) \text{ have a constant value }  &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega \tau\right)\frac{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t +\phi\right)}{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t +\phi\right)} \times \sin\left(\omega \tau\right)\frac{\int_{-\infty}^{\infty}\sin\left(\omega t + \phi\right)\times\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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \omega \tau + \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty}}{2 \omega \int_{-\infty}^{\infty} \sin^2\left(\omega t+ \phi \right)  \mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) =\cos \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, but the integral of cos(t)xsin(t) is not sin^2(t) in the last but one line.  cos(t)xsin(t) is an odd function so the integral from -inf to inf will be zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039; On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function of both Solid and Liquid simulations as well as the approximation from  the 1 dimensional harmonic oscillator are plotted in the graph shown below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Velocity Auto-correlation Function vs Timestep&lt;br /&gt;
|-&lt;br /&gt;
|[[File:VACF(7).png|650x550px|VACF]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
The mimimas in the VACFs for the solid and liquid systems indicate that the velocities of the atoms are reversed&amp;lt;br&amp;gt;&lt;br /&gt;
The VACFs  for the solid and liquid phase show the behavior of a dampened oscillator. They do not display perfect oscillatory behaviour due to frictional forces which causes it to oscillate with a frequency and amplitude that decreases over time. In the solid phase, atoms are held in fixed positions and can interact with neighboring atoms. In the liquid phase, atoms are no longer held in fixed positions and are able to move around more freely to interact with other atoms. The increased motion in the liquid phase has an increases dampening effect on its oscillatory behavior. As such, the VACF for the liquid phase decays at a much quicker rate compared to the solid phase.&amp;lt;br&amp;gt;&lt;br /&gt;
The VACF for the Harmonic oscillator represents a situation where there are no interactions to dampen oscillatory motion. It oscillates with only the restoring force acting on the system.The velocity goes in the reverse direction at the end of each oscillation. The VACF does not decay unlike the phases modelled using the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean by frictional forces?  The VACF decays because of collisions between particles.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to estimate the integral under the VACF for the solid liquid and gaseous phase. The calculation was also performed on a simulation of one million atoms. The plots are shown in the table below. &lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Running Integral Value - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Running Integral Value -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|[[File:Running Integral Atoms Solid(7).png|450x350px|Running Integral Solid Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms Solid (7).png|450x350px|Running Integral Solid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|[[File:Running Integral Liquid (7).png|460x350px|Running Integral Liquid Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms Solid Liquid (7).png|450x350px|Running Integral Liquid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|[[File:Running Integral Gas (7).png|450x360px|Running Integral Gas Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms(7).png|450x350px|Running Integral Gas Large]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the graphs, the diffusion coefficient for each system can be estimated using the following equation &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;The diffusion coefficients were estimated for each system and shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficent - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficient -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.000523 =0.000174 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.0001364 =4.54 \text{x} 10^{-5}  \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.29364 =0.0979  \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.27028 =0.0901 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 5.23060= 1.74 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 9.80553=3.27 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients obtained by approximating the area under the VACF integrals show a similar trend to the diffusion coefficients obtained from the MSD graphs.  &lt;br /&gt;
One source of error when estimating the diffusion coefficient from the VACF would be an ineffective trapezium approximation to the VACF curves. In the future, smaller timesteps could use used. This would provide a better estimation for the area under the integral by producing a better trapezium approximation. &lt;br /&gt;
&lt;br /&gt;
However, the greatest source of error while running the VACF simulation would be the amount of time units simulated when running the simulation. From the running integral graphs, we can see that the liquid and gaseous phases have not reached equilibrium and its value is still increasing. Running the simulation for a longer time would allow it to reach equilibrium and lead to a better estimation of diffusion coefficient values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:csw114liquidsim&amp;diff=601156</id>
		<title>Talk:Mod:csw114liquidsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:csw114liquidsim&amp;diff=601156"/>
		<updated>2017-03-12T14:41:35Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Correct&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with all tasks answered and results well presented.  Make sure you fully understand the background theory behind each task though so that you know exactly what the task is asking you and why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular reaction dynamics==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this section of the experiment,the Veloctiy-Verlet algorithm was used to model the behaviour of a classical harmonic oscillator.&lt;br /&gt;
From the data provided in the HO.xls files,the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot; were completed. &lt;br /&gt;
The graphs below plots 1) displacement,2) total enery 3) absolute error between the classical and Verlet-Velocity derived solutions.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Displacement vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Error vs Time&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Displacement Vs Time (0.1TS).png|center |500x400px |Displacement Vs Time]] &lt;br /&gt;
|[[File:Energy vs Time (0.1 TS).png|center |500x400px |Energy vs Time]] &lt;br /&gt;
|[[File:Error vs Time (0.1TS).png|center |500x400px |Error vs Time]] &lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of a classical  harmonic oscillator  was obtained by summing its potential and kinetic energy, according to the equation:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \text{Total Energy}  = U + K&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \text{Total Energy}  = \frac{1}{2}kx^2  + \frac{1}{2}mv^2&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs shown above, we can see that displacement and energy display an oscillating behaviour while the error between the  classical and Verlet-Velocity derived solutions increases over time &amp;lt;br&amp;gt;&lt;br /&gt;
The position of the maxima in the error column were found and plotted as a function against time.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Several different timesteps were experimented with to observe its effects on the harmonic oscilator.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Error&lt;br /&gt;
|-&lt;br /&gt;
|0.15&lt;br /&gt;
|[[File:Energy vs TIme (0.15 TS).png|center |400x500px |Energy Vs Time (0.15 Timestep)]] &lt;br /&gt;
|[[File:Error Vs Time (0.15 TS).png |center |400x500px|Error Vs Time (0.15 Timestep)]]&lt;br /&gt;
|-&lt;br /&gt;
|0.20&lt;br /&gt;
|[[File:Energy vs time (0.2TS).png|center |400x500px|Energy Vs Time (0.20 Timestep)]]&lt;br /&gt;
|[[File:Error vs time (0.2TS).png|center |400x500px |Error Vs Time (0.20 Timestep]] &lt;br /&gt;
|-&lt;br /&gt;
|0.30&lt;br /&gt;
|[[File:Energy vs TIme (0.3TS).png|center |400x500px |Energy Vs Time (0.30 Timestep)]]&lt;br /&gt;
|[[File:Error vs Time (0.3TS).png|center |400x500px |Error Vs Time (0.30Timestep]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the plots above, we can see that increasing the timestep for each simulation has the effect of increasing the amplitude and frequency of the oscillator. &lt;br /&gt;
The error also increases as the timestep increases. This is because data is sampled at a less frequent rate, increasing the margin for error in the system as a result. &lt;br /&gt;
We must monitor the total energy of a system to ensure that is obeying the law of energy conservation. By monitoring the total energy, we can monitor the equilibration process of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Did you decide which timestep gives you a variation in energy of less than 1? Why does the error oscillate over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When modelling simple fluid systems, the Lennard Jones Potential is suitable to describe the interactions of atom pairs to a high degree of accuracy.&lt;br /&gt;
The separation distance when potential energy = 0 occurs when &amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;. The force experienced at this distance is equivalent to &amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}&amp;lt;/math&amp;gt;(Workings shown in the table below)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Separation distance &amp;lt;math&amp;gt; r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Force &lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0 = \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}} =\frac{\sigma^{6}}{r^{6}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_i}4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{r}\left ( \frac{\sigma}{r} \right )^6 \left \lbrack\left ( \frac{\sigma}{r} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{r}\left ( \frac{\sigma}{r} \right )^6 \left \lbrack\left ( \frac{\sigma}{r} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma =r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}\left ( \frac{\sigma}{\sigma} \right )^6 \left \lbrack\left ( \frac{\sigma}{\sigma} \right )^2 -1\right \rbrack&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i =  \frac{24\varepsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;&#039;&#039;&#039; &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At equilibrium separation, the attractive and repulsive forces balances out each other. This occurs when &amp;lt;math&amp;gt; F = 0&amp;lt;/math&amp;gt;. The equilibrium separation occurs at &amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;. The well depth at this separation was evaluated to be  &amp;lt;math&amp;gt;\phi\left(r_{eq}\right)=-\epsilon&amp;lt;/math&amp;gt;. (Working shown below)&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Separation &lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Well Depth&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}\phi\left(r\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_i}4\varepsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;-4\epsilon \left(- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right) = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;- \frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;-12\sigma^{12} + 6\sigma^{6}r^6 = 0&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r^6 = 2\sigma^{6}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq} = \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -\epsilon&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&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;&#039;&#039;&#039;.&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard Jones potential curve was evaluated for 3 sets of limits, each representing different seperation distances between two atoms. &lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 300px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | &amp;lt;math&amp;gt;2\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |&amp;lt;math&amp;gt;2.5\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |&amp;lt;math&amp;gt;3\sigma - \infty&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({2\sigma}) ^{11}} + \frac{\sigma^6}{5({2\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({2}) ^{11}} + \frac{1}{5({2}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 0.024822 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248 \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({2.5\sigma}) ^{11}} + \frac{\sigma^6}{5({2.5\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({2.5}) ^{11}} + \frac{1}{5({2.5}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 8.1767\times10^{-3} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx - 8.177\times10^{-3} \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{2\sigma}^\infty  4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\varepsilon\left[ \frac{-\sigma^{12}}{11r^{11}} + \frac{\sigma^6}{5r^5}\right]&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 4\varepsilon \left(0\right)- 4\varepsilon  \left(- \frac{\sigma^{12}}{11({3\sigma}) ^{11}} + \frac{\sigma^6}{5({3\sigma}) ^5} \right) &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 -&amp;lt;/math&amp;gt;  &amp;lt;math&amp;gt; 4  \left(- \frac{1}{11({3}) ^{11}} + \frac{1}{5({3}) ^5} \right)  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;= 0 - 3.290\times10^{-3} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\approx - 3.290\times10^{-3} \left( 3  d.p.\right ) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Modelling realistic volumes of liquids===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The number of water molecules in 1 mL of water under standard conditions were estimated.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Estimating number of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O molecules in 1 mL&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;At 298K &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho_{{H_2}O} = 1 g mol^{-1} \approx  \text{1 g}  &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Number of mols} = \frac{1}{18.0} \approx \text{0.555 mols}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}= 0.0555 \times6.023 \times10^{23} =  3.346 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}=3.346 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{N}\approx3.35 \times 10^{23} \text{molecules}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules were evaluated as shown below:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Estimating volume of 10000 H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O molecules&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Volume of 10000 molecules} = 10000 \times \frac{1}{3.346\times 10^{23}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{V}= 2.9885\times10^{-19} \text{mL} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{V}\approx 2.99\times10^{-19}  \text{mL}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There should be 3x10^22 molecules of water in 1 ml, you are just out by a factor of 10, check your working. Volume of 10000 molecules is correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary  Function===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Implementing a Periodic boundary function implies that when a particle interacts  across a specified boundary , they can exit one end of the box and re-enter the other end. This enables the total number of particles in a box to stay constant. With the example shown below. The particle travels along a vector which would cause it to exit the box. However, instead of moving to the &amp;quot;next simulation box&amp;quot;, the periodic boundary function stipulates that it &amp;quot;re-enters&amp;quot; the same simulated box via the opposite side, as demonstrated with its final  position vector.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Position Vector&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;Position Vector before periodic boundary function = (0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Position Vector After periodic boundary function  = (0.2, 0.1, 0.7)&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Estimating Real Parameters for an Argon Atom===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt; &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When working with the Lennard Jones potential, &amp;quot;reduced units&amp;quot; are often used to simplify mathematical calculations.  Scaling factors are applied to experimental quantities to make expressions less cumbersome. In the exercise below, the real parameters for an Argon atom were calculated based on the reduced units provided.&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Distance&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Energy&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Force&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{r^*}= \frac{r}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{r} = 3.2\times 0.34nm &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{r} =1.08 nm&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{since}\frac{\epsilon}{k_B}=120K&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon =120K\times k_B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E = E* \times 120K \times k_B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E =0.9974  \text{kJ  mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;E \approx 0.9974 \text{kJ  mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= \frac{\epsilon}{k_B}\times\frac{1}{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= 120\times\frac{1}{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{T^*}= \frac{1}{180}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;T= 180k&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibrium==&lt;br /&gt;
===Defining positions of atoms===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? &#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Giving atoms a random staring position would only introduce computational errors if the two atoms end up on the same starting position. This would affect the pairwise atomic interactions calculated by the Lennard Jones potential. If the atoms are superimposed on top of each other, it would imply a separation distance of 0, causing its potential to tend to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt;. This would introduce errors when defining properties such as mass or velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: If particles start too close together the high repulsion forces can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Creating a simulation box===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. &amp;lt;br&amp;gt;Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The  simulation box used in this section of the experiment, has a lattice density of 0.8. &amp;lt;br&amp;gt;&lt;br /&gt;
For a primative lattice structure with one atom per unit cell&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{\text{Number  of  lattice  points}}{\mathrm{Volume}}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{1}{\left(1.07722\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=0.79999&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho\approx 0.8&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For a FCC  lattice with 4 atoms per unit cell and a number density of 1.2, the length of the unit cell was approximately 1.493. (Workings shown below)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\rho=\frac{\text{Number  of  lattice  points}}{\left(\text{Length}\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;1.2=\frac{1}{\left(1.07722\right)^3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\left(Length\right)^3=\frac{10}{3}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Length=1.49380&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;Length\approx 1.493 \left(3 dp \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
If a FCC lattice was used , 4000 atoms will be created as there are 4 lattice points per unit cell and the  simulation box contains 1000 unit cells.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Setting properties of atoms===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following code  used in simulations is related to the physical interactions between atoms.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 80%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Purpose&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;mass 1 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;Defines the mass for all atoms of one or more atom type.&amp;lt;br&amp;gt;&lt;br /&gt;
Each atom is associated with a specific mass. &amp;lt;br&amp;gt;&lt;br /&gt;
In this simulation, atoms of type 1 are assigned a mass of 1.0. &amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;pair_style lj/cut 3.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
It calculates the pairwise interactions between atoms using the Lennard-Jones potential. &amp;lt;br&amp;gt;&lt;br /&gt;
This line of code also defines an Rc term which  specifies the global cutoff value for calculation of the potential at a distance of 3.0.&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;center&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|&amp;lt;center&amp;gt;This line of code calculates the force field coefficients in the Lennard Jones Potential.&amp;lt;br&amp;gt;&lt;br /&gt;
The &amp;quot;wildcard&amp;quot; asterisk is able to set coefficients for all pairs of atom interactions within the system.&amp;lt;br&amp;gt;&lt;br /&gt;
In this simulation the codes sets the force field constants for all pair wise interactions at 1.0&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard Jones potential?  Why do we use a cutoff for the potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
We are able to use the Velocity-verlet alogritym as we have defined &amp;lt;math&amp;gt; x_i \left( 0 \right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i \left( 0 \right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the first code below. what do you think the purpose of these lines is? Why not just write (second code)?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height: 200px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | First code&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Second code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;br&amp;gt;&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes shown in the boxes can be  used when running simulations of a system.&lt;br /&gt;
Using the code in the first box allows us to vary the timestep of the simulation while running it for the same amount of time. &lt;br /&gt;
It calculates the number of steps needed for the simulation to be ran within a fixed time.&lt;br /&gt;
Although the number of steps taken will vary with timeset but it is within a fixed time frame.&amp;lt;br&amp;gt;&lt;br /&gt;
The code in the second box  will also allow us to vary the timestep but under slightly different conditions. This code  would change the run time of the simulation and does not calculate the number of steps needed to be taken to run the simulation for a fixed time frame.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Both pieces of code will run the same simulation, but the advantage of using variables as in the first case is that if we change the timestep, all properties which depend on the value of the timestep are also changed automatically.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibration===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The thermodynamics output of the &amp;quot;melt crystal&amp;quot; simulations  were analysed. &lt;br /&gt;
The simulation was ran at a timestep of 0.01.Graphs of energy, temperature and pressure against times are plotted and shown below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total Energy vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Temperature vs Time&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |Pressure vs Time&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Total_energy_vs_time_(3).png|350x250px|Total Energy vs Time]]&lt;br /&gt;
|[[File:Temperature_vs_Time_(3).png|350x250px|Temperature vs Time]]&lt;br /&gt;
|[[File:Pressure_vs_Time_(3).png|350x250px|Pressure vs Time ]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs, we see see that the system reaches equilibrium as the output can be seen fluctuating around a constant value. It can be seen that the system reaches equilibrium around 0.3 to 0.4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Several simulations were ran at different time steps, a plot of total energy of each system vs time is shown in the graph below&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total energy vs Time (At different timesteps)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Time_vs_Energy_ALl_timestep_(3).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
As the time step decreases, the total number of steps taken in the simulation increases.&lt;br /&gt;
From the data, we can see that total energy for a timestep =0.015, increases with time and diverges. The system has not reached equilibrium and will not provide useful information can be gathered.It breaking the law of conservation of mass and is an indication that there are errors within the simulation. &amp;lt;br&amp;gt;&lt;br /&gt;
With the 4 other timesteps chosen, it can be seen that total energy decreases over time and slowly begins to fluctuation around an equilibrium value. &amp;lt;br&amp;gt;&lt;br /&gt;
With a smaller timestep chosen the accuracy of calculations increase. This would imply that among the 5 simulations ran, a timestep of 0.001 would provide the most accurate physical data regarding our system under consideration. However, it would be computationally very expensive. On the other hand a timestep of 0.0025 would provide a good balance, providing accuracy whilst giving us a reasonable time to monitor the system. The data obtained at a timestep of 0.0025 shows that it provides comparable output data in relation to a timestep of 0.001.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The largest timestep doesn&#039;t conserve energy, but mass is unaffected by the timestep.  The average total energy should not depend on the choice of timestep, as it does for 0.01 and 0.0075, so the best choice is 0.0025.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;.Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The temperature of the system can be controlled by multiplying it with a constant factor  &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
In the calculations below, a value of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; has been calculated to ensure that  the instantaneous temperature (T) is equivalent to the target temperature  &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;br&amp;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;&amp;lt;br&amp;gt;&lt;br /&gt;
Multiplying every velocity by gamma&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(v_i*\gamma\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2\gamma^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {\frac{3}{2} N k_B \mathfrak{T}}  {\frac{1}{2}\sum_i m_i v_i^2T} &amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma =\pm\sqrt{ \frac {\mathfrak{T}}{T} }&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, gamma is the positive root as we don&#039;t want to change the direction of the particles velocity, just scale the magnitude of the velocity.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The following lines of code were used to run the simulation.&amp;lt;br&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 70%; height:50px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Input code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The first value 100 stipulates that the simulation will calculate average thermodynamic data with a space of every 100 timesteps.  The second value 1000 causes the simulation to use 1000 data points to calculate the thermodynamic values. The third value,10,000, refers to the total number of timesteps to be used in the simulation.&lt;br /&gt;
With a timestep of 0.0025 and 10000 steps will result in a simulation time of 250.&lt;br /&gt;
&lt;br /&gt;
===Equation of State===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;:  Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Variable&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Values&lt;br /&gt;
|-&lt;br /&gt;
|Pressure&lt;br /&gt;
|2.45 , 2.75&lt;br /&gt;
|-&lt;br /&gt;
|Temperature&lt;br /&gt;
|1.6, 1.8, 2.0, 2.2, 2.4 &lt;br /&gt;
|-&lt;br /&gt;
|Timestep&lt;br /&gt;
|0.0025&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
In this section of the experiment, the isobaric-isothermal ensemble is used to calculate the equation of state&lt;br /&gt;
This produced a set of 10 data points which are plotted in the graph shown below.&lt;br /&gt;
The ideal gas equation was also used to &#039;predict&#039; the density at each given temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Pressure =  2.75&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Pressure = 2.45&lt;br /&gt;
|-&lt;br /&gt;
|[[File:DEnsity 2.75 vs Temp(4).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|[[File:Density vs Temp (4).png|550x450px|Total Energy vs Time]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
We can see that the ideal gas law predicts a higher density value compared to calculated values as it does not take into account inter-atomic interactions. The ideal gas law treats atoms as randomly moving points without any volume.  It assumes that there are no repulsive interactions between atoms. Atoms would be closer together in comparison to the Lennard Jones potential model as they are not repelling each other. This leads to a higher calculated density  as there are more atoms per unit area (in the ideal gas model).&amp;lt;br&amp;gt;&lt;br /&gt;
On the other hand, the calculated densities are derived using the Lennard Jones potential and takes into account attractive and repulsive forces between atoms, resulting in deviations between the predicted and calculated densities.  The ideal gas equation is only useful for modelling real fluidic systems at low densities where there are minimal atom interactions. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how does the discrepancy between the ideal gas and simulation results change with pressure and temperature?  Plot all of the data on one graph to see the trends more clearly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities using statistical physics==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity refers to the amount of energy needed to raise the temperature of a system by 1k.&amp;lt;br&amp;gt;&lt;br /&gt;
In this section, the heat capacities were plotted as a function of time to produce a total of 10 data points as shown in the graph below. The simulation conditions used are shown in the table on the right&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Variable&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Values&lt;br /&gt;
|-&lt;br /&gt;
|Density&lt;br /&gt;
|0.2,0.8&lt;br /&gt;
|-&lt;br /&gt;
|Temperature&lt;br /&gt;
|2.0, 2.2, 2.4, 2.6, 2.8 &lt;br /&gt;
|-&lt;br /&gt;
|Atoms&lt;br /&gt;
|3375&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Total energy vs Time (At different timesteps)&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Heat cap vs Temp (5).png|650x550px|Heat capacity vs VTemp]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graph, we can see that increasing the temperature leads to a decrease in heat capacity. &lt;br /&gt;
As the temperature of the system increases, it is possible to excite the particles to a higher energy level. However, as the higher energy states become increasingly populated, it becomes harder for the system to absorb more energy, thus leading to a lower specific heat capacity&amp;lt;br&amp;gt;&lt;br /&gt;
From the graph, we can also see that density is proportional to heat capacity.  Increasing the density of a system increases the number of atoms per unit cell. This increases the number of accessible mirco-states. The system is able to absorb more energy per unit cell, thus leading to a higher heat capacity. This also shows that  heat capacity is an extensive property.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be inferred that the system has a finite number of energy levels as the heat capacity has not reached a constant value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Remember that your simulations are classical so there are no discrete energy levels.  Why did you choose to fit your data with the line shown in the graph?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Input code===&lt;br /&gt;
The following input code was used to calculate the heat capacity&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Input code&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;#### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&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.6&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;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp atoms vol density&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable N equal atom&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable vol equal vol&lt;br /&gt;
variable density equal density&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp v_temp2 v_density&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable T2 equal f_aves[4]&lt;br /&gt;
variable tempave equal f_aves[3]&lt;br /&gt;
variable E2 equal f_aves[1]*f_aves[1]&lt;br /&gt;
variable EE equal f_aves[2]&lt;br /&gt;
variable top equal ${EE}-${E2}&lt;br /&gt;
variable heatcap equal (${top}/${T2})*${N2}&lt;br /&gt;
variable heatcapvol equal ${heatcap}/vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Here are the results from this calculation!! &amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${tempave}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacty/Vol: ${heatcapvol}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacty: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r) \text{ and } \int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:right&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable floatright&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #C6E2DA; color: black;&amp;quot; | Phase&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Temperature&lt;br /&gt;
! style=&amp;quot;background: #CDB8A0; color: black;&amp;quot; | Density&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1.2&lt;br /&gt;
|1.1&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|1.2&lt;br /&gt;
|0.8&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|1.2&lt;br /&gt;
|0.1&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Data on the  structure of the Lenard Jones   system can be characterised by its radial distribution function. &lt;br /&gt;
In this section of the experiment, the radial distribution functions &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; were calculated for the solid, liquid, and vapour phases . Plots of  &amp;lt;math&amp;gt;g(r) \text{ and } \int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
are shown below. Simulation conditions are provided on the right. A timestep of 0.002 was used to perform this set of simulations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | &amp;lt;math&amp;gt;g\left(r\right)&amp;lt;/math&amp;gt; vs distance&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; |  &amp;lt;math&amp;gt;\int g\left(r\right)&amp;lt;/math&amp;gt; vs distance&lt;br /&gt;
|-&lt;br /&gt;
|[[File:RDF Graph 2 (6).png|550x450px|RDF integral]]&lt;br /&gt;
|[[File:RDF Graph (6).png|550x450px|RDF integral]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A peak indicates a favoured separation distance for the neighbours from a reference atom.&lt;br /&gt;
The number of peaks in each radial distribution function decreases in the following manner : Solid&amp;gt; Liquid &amp;gt;Gas.  &lt;br /&gt;
*Gas Phase&lt;br /&gt;
The rdf of the Gas phase shows one main peak before it decays to a value of one as the distance r increases. Structurally, the  Gaseous phase lacks a regular structure thus heavily influencing its rdf. It also suggest that it only has one coordination sphere surrounding the reference atom. The peak present for the gaseous states is significantly broadened possibly due to the thermal motion of the atoms. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Liquid Phase&lt;br /&gt;
The rdf of the liquid phase shows a fewer number of peaks compared to the solid phase.  This is because there is local ordering within the liquid phase but no long range order. The first peak in the rdf is the highest, indicating that the reference atom experiences the strongst attractive and repulsive interactions with its nearest neighbour. &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Solid Phase&lt;br /&gt;
The rdf of the Solid phase shows multiple peaks even as the distance increases. This is because Solids display long range order where atoms are arranged in a orderly manner.  Each peak on the rdf of the solid phase corresponds to the atoms &#039;nearest neighbour, with the first peak corresponding to the first  nearest neighbours, second peak corresponding to the  second nearest neighbour etc.&amp;lt;br&amp;gt;&lt;br /&gt;
For a face centered cubic lattice, with a lattice parameter &amp;quot;a&amp;quot; and  unit cell length of 1.49380, the distance of its neighbours were calculated and compared to experimental values as shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Peak Number&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Lattice Spacing (Theoratical)&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Lattice Spacing (Calculations)&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Coordination Number&lt;br /&gt;
|-&lt;br /&gt;
|1 (Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sqrt{2}}{2}a= = 1.06 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.025&lt;br /&gt;
|12&lt;br /&gt;
|-&lt;br /&gt;
|2 (Second Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt;a = 1.49 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.457&lt;br /&gt;
|6&lt;br /&gt;
|-&lt;br /&gt;
|3 (Third Nearest Neighbour)&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{\sqrt{6}}{2}a = 1.83 \text{ (3sf) }&amp;lt;/math&amp;gt;&lt;br /&gt;
|1.825&lt;br /&gt;
|24&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
A zoomed in version of the radial distribution function for the solid simulation is shown below. The distances between the reference atom and its 3 nearest neighbors are indicated on the graph.&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 200px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Radial Distribution Function Solid Phase&lt;br /&gt;
|-&lt;br /&gt;
|[[File:RDF solid phase zoom (6).png|550x450px|RDF integral]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good description of the solid, liquid and gas RDFs.  The lattice spacing is the width of the unit cell, not the distance to the first nearest neighbour in an fcc lattice, what do the results in your table show? How did you calculate the coordination numbers for the first three peaks? Showing the atoms responsible for these peaks on a diagram of an fcc lattice would have been good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;TASK: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mean squared displacements of small and large systems were studied for the solid, liquid and gaseous phase. This was plotted as a function against time and shown below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Mean Squared Displacement (Total) - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Mean Squared Displacement (Total) -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|[[File:MSD Solid (7).png|450x350px|MSD Solid Small]]&lt;br /&gt;
|[[File:MSD Solid Large system (7).png|450x350px|MSD Solid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|[[File:MSD Liquid (7).png|460x350px|MSD Liquid Small]]&lt;br /&gt;
|[[File:MSD Liquid Large System (7).png|450x350px|MSD Liquid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|[[File:MSD Gas (7).png|450x360px|MSD Gas Small]]&lt;br /&gt;
|[[File:MSD Gas Large System (7).png|450x350px|MSD Gas Large]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the graphs showing Mean Squared Distance against timestep, the diffusion coefficient for each system can be estimated using the following equation &lt;br /&gt;
&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;.The diffusion coefficients were estimated for each system and shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficent - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficient -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\approx 0&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times \frac{4.0226-1.97381}{2000\times0.002}=0.085&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{4.1237-2.00809}{2000\times0.002}=0.0820&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{64.2573-25.760}{2000\times0.002}=1.60&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{6}\times\frac{105.541-36.398}{2000\times0.002}=2.88&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the table, we can see that the diffusion coefficient increases in the following order:  Solid , Liquid. Gas. &amp;lt;br&amp;gt;&lt;br /&gt;
The diffusion coefficient of the solid phase is negligible as the atoms are held in fixed positions. &lt;br /&gt;
The diffusion coefficients for the Liquid and Gaseous phases  increase with time. In these two phases, the atoms are no longer held in fixed positions and have greater molecular motion. The gaseous phase shows a higher diffusion coefficient compared to the liquid phase. This is due to the difference in densities between the two states. In the gaseous phase, molecules have a greater mean free path and can travel a further distance before colliding with another molecule.&lt;br /&gt;
Moreover, atoms in the gaseous phase experience weaker intermolecular forces and are able to move with a greater degree of freedom.&lt;br /&gt;
&lt;br /&gt;
The simulation was also repeated for large systems containing one million atoms and the results are similar to the results obtained from simulations of small systems&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: To calculate D you should only fit a straight line to the linear part of the MSD graph as this is the diffusive regime, not the whole data set.  Why is the gas MSD graph curved at short times?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator &#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator is evaluated.&amp;lt;br&amp;gt;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 100px;margin-left: auto; margin-right: auto;font-size: 87%;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | VACF of the 1D Harmonic Oscilator.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \text{ Since }  x(t) = A\cos\left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{\mathrm{d}x(t)}{\mathrm{d}t} = -A \omega \sin \left( \omega t + \phi \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} -\omega A\sin\left(\omega t + \phi\right) \times -\omega A\sin\left(\omega (t + \tau) + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \omega^{2} A^{2}\sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty}\sin\left(\omega t + \phi\right) \times \sin\left(\omega t + \tau + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Using the identity} \sin\left(A +B\right) = \sin\left(A \right)\cos\left(B\right) + \sin\left(A \right)\cos\left(B \right)&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\text{Where }(\omega t + \phi) = \text{ and }\omega \tau = B&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi\right) \times \sin\left(\omega t + \phi \right)\cos\left(\omega \tau\right)\mathrm{d}t + \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}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\cos\left(\omega \tau\right) \text{ and } \sin\left(\omega \tau\right) \text{ have a constant value }  &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega \tau\right)\frac{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t +\phi\right)}{\int_{-\infty}^{\infty} \sin^{2}\left(\omega t +\phi\right)} \times \sin\left(\omega \tau\right)\frac{\int_{-\infty}^{\infty}\sin\left(\omega t + \phi\right)\times\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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos \omega \tau + \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty}}{2 \omega \int_{-\infty}^{\infty} \sin^2\left(\omega t+ \phi \right)  \mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) =\cos \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct result, but the integral of cos(t)xsin(t) is not sin^2(t) in the last but one line.  cos(t)xsin(t) is an odd function so the integral from -inf to inf will be zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039; On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function of both Solid and Liquid simulations as well as the approximation from  the 1 dimensional harmonic oscillator are plotted in the graph shown below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 300px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Velocity Auto-correlation Function vs Timestep&lt;br /&gt;
|-&lt;br /&gt;
|[[File:VACF(7).png|650x550px|VACF]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
The mimimas in the VACFs for the solid and liquid systems indicate that the velocities of the atoms are reversed&amp;lt;br&amp;gt;&lt;br /&gt;
The VACFs  for the solid and liquid phase show the behavior of a dampened oscillator. They do not display perfect oscillatory behaviour due to frictional forces which causes it to oscillate with a frequency and amplitude that decreases over time. In the solid phase, atoms are held in fixed positions and can interact with neighboring atoms. In the liquid phase, atoms are no longer held in fixed positions and are able to move around more freely to interact with other atoms. The increased motion in the liquid phase has an increases dampening effect on its oscillatory behavior. As such, the VACF for the liquid phase decays at a much quicker rate compared to the solid phase.&amp;lt;br&amp;gt;&lt;br /&gt;
The VACF for the Harmonic oscillator represents a situation where there are no interactions to dampen oscillatory motion. It oscillates with only the restoring force acting on the system.The velocity goes in the reverse direction at the end of each oscillation. The VACF does not decay unlike the phases modelled using the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean by frictional forces?  The VACF decays because of collisions between particles.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The trapezium rule was used to estimate the integral under the VACF for the solid liquid and gaseous phase. The calculation was also performed on a simulation of one million atoms. The plots are shown in the table below. &lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Running Integral Value - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Running Integral Value -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|[[File:Running Integral Atoms Solid(7).png|450x350px|Running Integral Solid Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms Solid (7).png|450x350px|Running Integral Solid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|[[File:Running Integral Liquid (7).png|460x350px|Running Integral Liquid Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms Solid Liquid (7).png|450x350px|Running Integral Liquid Large]]&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|[[File:Running Integral Gas (7).png|450x360px|Running Integral Gas Small]]&lt;br /&gt;
|[[File:Running Integral Million Atoms(7).png|450x350px|Running Integral Gas Large]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the graphs, the diffusion coefficient for each system can be estimated using the following equation &lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;The diffusion coefficients were estimated for each system and shown in the table below:&lt;br /&gt;
&amp;lt;Center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50%; height: 150px; margin-left: auto; margin-right:auto; font-size: 87%&amp;quot;;&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black; width: 50px;&amp;quot;| Phase&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficent - Small Systems&lt;br /&gt;
! style=&amp;quot;background: #ADC3B7; color: black;&amp;quot; | Diffusion Coefficient -  Large Systems&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.000523 =0.000174 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.0001364 =4.54 \text{x} 10^{-5}  \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.29364 =0.0979  \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 0.27028 =0.0901 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 5.23060= 1.74 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
||&amp;lt;math&amp;gt;\text{D} = \frac{1}{3}\times 9.80553=3.27 \text{ 3sf }&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients obtained by approximating the area under the VACF integrals show a similar trend to the diffusion coefficients obtained from the MSD graphs.  &lt;br /&gt;
One source of error when estimating the diffusion coefficient from the VACF would be an ineffective trapezium approximation to the VACF curves. In the future, smaller timesteps could use used. This would provide a better estimation for the area under the integral by producing a better trapezium approximation. &lt;br /&gt;
&lt;br /&gt;
However, the greatest source of error while running the VACF simulation would be the amount of time units simulated when running the simulation. From the running integral graphs, we can see that the liquid and gaseous phases have not reached equilibrium and its value is still increasing. Running the simulation for a longer time would allow it to reach equilibrium and lead to a better estimation of diffusion coefficient values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=596843</id>
		<title>Talk:Mod:wern-liquidsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=596843"/>
		<updated>2017-03-08T16:21:25Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with all tasks answered.  Try to make your written explanations a bit more focused and concise to highlight the key points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= The Simulation of Simple Liquids through Molecular Dynamics =&lt;br /&gt;
== Theory of Molecular Dynamics ==&lt;br /&gt;
Molecular dynamics involves simulating how particles in a system move with time, by calculating the relevant velocities, forces and displacements of the particles. In the ergodic hypothesis, whereby the time-average of the system is equivalent to the average of a large number of sampled configurations of the system, molecular dynamics would be able to simulate the time-average part of this hypothesis.&lt;br /&gt;
&lt;br /&gt;
In this experiment, we will use molecular dynamics to simulate a simple liquid governed by Lennard-Jones interactions. The algorithm for calculating the various dynamics of the particles is called the Velocity-Verlet algorithm, and it uses the approximation that the particles obey Newton&#039;s Laws (behave classically).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK : &#039;&#039;&#039;The accuracy of the algorithm was tested by using it to calculate the various dynamics and energies of a simple harmonic oscillator, and comparing it against the exact solutions. &lt;br /&gt;
&lt;br /&gt;
[[Image:errliq10.png|frame|none|Comparison of the displacement functions calculated analytically and by the algorithm.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen, the function calculated by the algorithm (red line) almost has a complete overlap with the analytical function for the SHO displacement (dotted line). This indicates that our algorithm (the Velocity-Verlet) is quite accurate at simulating this system numerically (and at the timestep of 0.1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For the timestep of 0.1, the peaks of the error between the displacement calculated by the algorithm and the exact displacement were seen to rise in height linearly with time, as shown by the plot below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq102.png|frame|none|The upper plot shows the error between the analytical and algorithmic values of the displacement. The lower plot shows that a linear line can be fitted through the heights of the error maxima]]&lt;br /&gt;
&lt;br /&gt;
The equation of the linear fit is shown, and it can be seen that it has a high R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value, indicating that the points correlate with a linear fit very well.&lt;br /&gt;
&lt;br /&gt;
The linear fit was made by estimating the position of the error maxima, and the table of the estimates is given below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Time (estimate)&lt;br /&gt;
  |Error Height&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |2&lt;br /&gt;
  |0.000758457&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |5&lt;br /&gt;
  |0.001999391&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |8&lt;br /&gt;
  |0.00330076&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |11&lt;br /&gt;
  |0.00458839&lt;br /&gt;
&lt;br /&gt;
 |-&lt;br /&gt;
  |14&lt;br /&gt;
  |0.00578735&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Overall, the fit indicates that as time passes, the discrepancy between the algorithmic and analytical methods would increase. However, the gradient for the change is quite small, whereby each increment of time increases the error by roughly 0.0004. Therefore, even if we were to run 1000 iterations of a timestep of 0.1, we would reach a total time of 100, which would give an error of 100 × 0.0004 = &#039;&#039;&#039;0.04&#039;&#039;&#039;. Compared to the maximum displacement of the oscillator, which is 1.0, this is still only an error of ~ 4%. Therefore, it can be concluded that the error increases at such a slow rate with time that running a sizable amount of timesteps would still allow the simulation to remain within a reasonable approximation to the exact solution. Of course, this applies only to a timestep of 0.1, and the next task explores the effects of changing timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The displacement for a harmonic oscillator can be described by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator can be given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;TE=\frac{1}{2}mv^2+\frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are all equal to one for the displacement equation, then the analytical total energy is simply half the amplitude squared, which would be &#039;&#039;&#039;0.5&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Upon choosing different timesteps, the total energy of the algorithm solution oscillated between the analytical total energy and a lower value. It was seen that &#039;&#039;&#039;a timestep equal to or less than 0.2 would not change the total energy by more than 1%. &#039;&#039;&#039;The plot of the total energy of the Velocity-Verlet algorithm solution against time with a timestep of 0.2 is given below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq3.png|frame|none|Oscillating total energy with time of the algorithm solution. The lower bound never reaches more than 1% below the analytical total energy.]]It is important to monitor the total energy of a system you are modelling numerically because:&lt;br /&gt;
* Comparing the numerical total energy values with the analytical values can tell you how accurate your algorithm is at modelling the system.&lt;br /&gt;
* One needs to observe whether the total energy has converged towards a constant average value, which would indicate that the system has reached thermodynamic equilibrium at its lowest energy state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;To simulate the interactions between atoms in our simple liquid, the Lennard-Jones potential was used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to attain a potential equal to zero, the two terms in the brackets must equal each other.&lt;br /&gt;
&lt;br /&gt;
The separation&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;at which the potential energy is zero is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at a given separation is attained after differentiating the potential equation wrt&amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(r) = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(\sigma) = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;is when&amp;lt;math&amp;gt;F=0&amp;lt;/math&amp;gt;. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=2^{1/6}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The potential energy at the equilibrium separation is given by:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)=4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential was evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int\phi\left(r\right) dr= 4\epsilon \left( \frac{\sigma^{6}}{5r^{5}} - \frac{\sigma^{12}}{11r^{11}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixing &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;to one, the following integrals were evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2\sigma}\phi\left(r\right) dr= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2.5\sigma}\phi\left(r\right) dr= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{3\sigma}\phi\left(r\right) dr= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, but you could simplify your answer for the force at r0.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; In 1 mL of water under standard conditions, the density is approximately 1 g mL&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, and the Mr of water is 18. The number of molecules can then be calculated:&lt;br /&gt;
&lt;br /&gt;
1/18 × 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;3.35 × 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; molecules&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Similarly the volume occupied by just 10000 water molecules can be calculated as:&lt;br /&gt;
&lt;br /&gt;
10000 / ( 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; ) × 18 = &#039;&#039;&#039;3.00 × 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since the volume simulated by just 10000 molecules is extremely small, periodic boundary conditions are imposed in order to better approximate bulk liquids. In such a system, an atom at position &#039;&#039;&#039;(0.5, 0.5, 0.5)&#039;&#039;&#039; in a cubic simulation box running from (0, 0, 0) to (1, 1, 1) which moves &#039;&#039;&#039;along a vector (0.7, 0.6, 0.2)&#039;&#039;&#039; would &#039;&#039;&#039;reach the position (0.2, 0.1, 0.7)&#039;&#039;&#039; after applying the periodic boundary conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Reduced units will also be used for the thermodynamic variables in the simulation.  &lt;br /&gt;
* Using the Lennard-Jones parameters for argon, if the LJ cutoff occurs at &#039;&#039;&#039;r* = 3.2, &#039;&#039;&#039;it is &#039;&#039;&#039;r = 1.088 nm&#039;&#039;&#039; in real units (σ&amp;lt;sub&amp;gt;Ar&amp;lt;/sub&amp;gt; = 0.34 nm). &lt;br /&gt;
&lt;br /&gt;
* The well-depth is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;as calculated before, and its value in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; can be calculated as:&lt;br /&gt;
&lt;br /&gt;
ⲉ / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120 K&lt;br /&gt;
&lt;br /&gt;
ⲉ = 1.656 × 10&amp;lt;sup&amp;gt;-21&amp;lt;/sup&amp;gt; J&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ⲉ = 0.997 kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* The reduced temperature &#039;&#039;&#039;T* = 1.5&#039;&#039;&#039; in real units would be&#039;&#039;&#039;:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T&#039;&#039;&#039; = 1.5 × ⲉ / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= &#039;&#039;&#039;180 K&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
In order to start our algorithm we need to assign the initial positions of our atoms. However, liquids don&#039;t have long range order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Though assigning random positions to the atoms inside the simulation box would achieve the lower degree of long range order characteristic of liquids, this could cause problems. If you have two atoms generated very close to each other for example, the LJ potential will approach infinity at the small separation, generating a large repulsive force between them. If the simulation randomly generates many atom pairs too close to each other, most of the atoms in the system will fly apart from each other at very high speeds due to experiencing strong repulsive forces (i.e. the entire system will fly apart). This is not characteristic of a flowing liquid whereby the atoms are at a separation whereby they are still held together by attractive forces. Or rather, liquids don&#039;t spontaneously fly apart, but instead flow.&lt;br /&gt;
&lt;br /&gt;
Therefore, the simulation will start from a simple cubic lattice. If simulated for a long enough time under the correct potentials, the atoms will rearrange into positions more reminiscent of a liquid (i.e. we have melted the crystal)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces make the simulation unstable and can cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Within the input file, the following command creates a simple cubic lattice (one lattice point per unit cell), with a number density of 0.8.&lt;br /&gt;
 lattice sc 0.8&lt;br /&gt;
The output file indicates that the distance between the LPs is 1.07722 (reduced units).&lt;br /&gt;
 Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
Within a cubic lattice, the LPs all occupy the corners of a cube, but the cube itself contains just one LP (due to sharing the LP with other cubes). Therefore the number density can be calculated as:&lt;br /&gt;
&lt;br /&gt;
1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;0.8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This indeed corresponds to the above input.&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 LPs for every cube, since the corner LPs are still present (and contribute 1/8 of an LP) and the facial LPs each contribute 1/2 of an LP. For a face-centered cubic lattice with a number density of 1.2, the side length will be (in reduced units):&lt;br /&gt;
&lt;br /&gt;
(4 / 1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;1.49380&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For a face-centered cubic lattice, we assume that the following commands were inputted:&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
There would be 1000 unit cells contained within the entire box. Since a face-centered cubic lattice has 4 LPs per unit cell, there would be &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; of type 1 within this simulation box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Within the LAMMPS script, the properties of the atoms and the interactions have to be specified through the following parameters:&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;
* The first line sets the masses of the atoms belonging to Type 1 to 1.0 (reduced units). Since a pure liquid is being simulated, only one atom type is present (Type 1).&lt;br /&gt;
* The second line adds pairwise LJ potential interactions between the atoms, whereby the interaction is calculated only if the atoms have a distance between them which is lower than or equal to 3.0 (reduced units). This cutoff or &#039;&#039;&#039;truncation&#039;&#039;&#039; of the potential is justified, since the integral of the LJ potential between a separation distance of 3.0 and positive infinity was previously calculated to be a small number. This signifies that interactions between atoms at a distance of 3.0 or higher are very small, and that they can be ignored within the simulation.&lt;br /&gt;
* The third line sets the two coefficients of the LJ potential (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;and&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;) for a pair of atoms. The two asterisks indicate that the coefficients will be applied to the LJ potential of &#039;&#039;all&#039;&#039; the pair interactions between the atoms (the equivalent of writing &amp;lt;math&amp;gt; \sum_i^N \sum_{i \neq j}^{N}&amp;lt;/math&amp;gt;). The coefficients are set to 1.0 in this case.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since &amp;lt;math&amp;gt;x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are being specified for this simulation, the Velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The following lines were typed into the input script&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The second line creates a variable named &#039;timestep&#039; and assigns it a value of 0.001. This way, any subsequent line can easily call the variable&#039;s value again by typing ${timestep}. This allows for the timestep value to be more easily manipulated and stored in memory so that it can be easily accessed throughout the script. Furthermore, if the value needs to be changed, only the first line which created the variable needs to have the value changed and all subsequent variable calls will change value as well. This is a lot more effective than simply assigning the same value repeatedly to each function call.&lt;br /&gt;
&lt;br /&gt;
The purpose of the subsequent lines is to define more variables, such as the number of steps, to be used later as well. Since defining these variables relies on the values of previous variables, if the value of the previous variables were to change, then these variables would also scale appropriately with the change, which is another advantage of using variables.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;After running the simulation, plots of the energy, temperature and pressure of the simulated liquid system against time were made for when a timestep of 0.001 was used. Additionally, a plot of the energy of the system against time for different timestep sizes was also made:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq123.png|frame|none|Plots of various thermodynamic variables with time. A plot of the energy of the system against time for various timestep sizes is included at the bottom left.]]&lt;br /&gt;
&lt;br /&gt;
The system simulated at a timestep of 0.001 can be seen to reach an equilibrium in energy, temperature and pressure very quickly (less than 5.0 time units into a simulation that simulates 100 time units) as all three values rapidly reach an oscillation around an average value.&lt;br /&gt;
&lt;br /&gt;
Using the bottom left plot, it can be seen that the timestep of 0.0025 is the largest timestep that gives acceptable results, since it is larger than the 0.001 timestep but is seen to oscillate approximately around the same average total energy as that of the 0.001 timestep system. The larger timesteps may still give a stable average total energy (excluding 0.015), but these are higher than the average energy indicated by the timestep of 0.0025, which indicates that the higher timesteps have simulated a system which hasn&#039;t converged to the lowest energy state, which is the equilibrium state we desire.&lt;br /&gt;
&lt;br /&gt;
Particularly, choosing the largest timestep of 0.015 is a particularly bad choice because it doesn&#039;t even give a stable average total energy within the time given. Instead, it gives a total energy that increases further with time, which definitely indicates that the simulated system is not at an equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, average total energy should not depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions (the NpT ensemble) ==&lt;br /&gt;
&#039;&#039;&#039;TASK (Choosing 10 phase points in the NpT ensemble): &#039;&#039;&#039;From the previous simulation under the NVE ensemble, it was seen that a timestep of 0.0025 was the largest that still gave a convergent energy for the system. The average temperature and pressure of the system under the NVE ensemble at a timestep of 0.001 was also calculated after cutting off the first 100 data points (there were 4000 data points for the temperature and pressure, so excluding the first 100 would remove the transient behavior while still leaving enough data points to calculate a reliable average). The following are the averages:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T* = 1.256&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;P* = 2.615&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From these averages indicated by the NVE ensemble, it can be seen that varying the pressure around the value of 2.6 would give reasonable results within the NpT ensemble. Ten simulations of the NpT ensemble were created, whereby a temperature range of 1.6, 1.8, 2.0, 2.2 and 2.4 was chosen and measured at the pressures of 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The temperature of the simulated system can be calculated using the equipartition theorem. However, the simulated temperature may differ from that of the target temperature, and so a factor of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be multiplied with the velocities for the sum of the kinetic energy of the atoms in order to equalize with the target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. Through this relation, one can solve for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2}Nk_BT=\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i  v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2=\frac{\frac{3}{2} N k_B \mathfrak{T}} {\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T} }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The following commands were given to adjust how many times the state of the system was measured.&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&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;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
On the&lt;br /&gt;
second last line, the values 100, 1000 and 100000 signify the way in which the&lt;br /&gt;
average of a certain variable is calculated. Specifically, there will be 1000&lt;br /&gt;
values of the temperature and other variables used to calculate the average&lt;br /&gt;
value on timestep 100000. Since the simulation only runs for 100000 timesteps,&lt;br /&gt;
there will only be one average calculated (if the value of 100000 was changed&lt;br /&gt;
to 10000 for example, there would be ten average values calculated at every&lt;br /&gt;
10000th timestep). The value of 100 indicates that the 1000 values used&lt;br /&gt;
to calculate the average will be taken from every 100 timesteps before the&lt;br /&gt;
100000th timestep. &lt;br /&gt;
&lt;br /&gt;
In other&lt;br /&gt;
words, for our simulation there will be 1000 values chosen from 1000 timesteps,&lt;br /&gt;
and the first four timesteps of the 1000 timesteps are 100000, 99900, 99800,&lt;br /&gt;
and 99700. This decrease by 100 timesteps will continue until we have the values from 1000 timesteps. The values sampled will then be used to calculate the average at the&lt;br /&gt;
100000th timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The densities of the various simulations were plotted against the corresponding temperatures and pressures with errors. Additionally, plots of the ideal gas density against temperature were also made for comparison.&lt;br /&gt;
[[Image:errliq12345.png|frame|none|Plots of the density against temperature for the NpT simulations at two different pressures. The lower graph also includes the equivalent plot using the ideal gas equation for comparison.]]The simulated densities are much lower than the equivalent densities plotted by the ideal gas law. This is because the ideal gas doesn&#039;t take into account any interactive forces between atoms, so atoms could cluster together as close as they want without any interaction occurring, allowing for more dense systems. Our simulation uses the LJ potential to supplie interactive forces between atoms, and it is the large repulsive term in the LJ potential equation that dominates the behavior of the LJ liquid. Since the potential and subsequent repulsive force would increase rapidly with decreasing separation, the atoms in our simulation will always keep a larger distance apart from each other within a certain volume, which would give them a lower density than the ideal gas at the same pressure and temperature.  &lt;br /&gt;
&lt;br /&gt;
This discrepancy appears to increase at higher pressures, since the height separation between the simulation plot and ideal gas plot at a pressure of 3.0 is higher than that at 2.5. This is because higher pressures for the ideal gas would continue to compress the atoms closer together without any hindrance from repulsive forces, while our LJ liquid does not change as much in density due to pressure since the repulsive forces are still holding the atoms at a certain distance apart.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation, how does the discrepancy between simulation and ideal gas results change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Heat Capacity ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The simulation was run using the NVT ensemble so as to calculate the heat capacity of the system. The plot below shows the simulation being run through a range of temperatures and two densities, with the heat capacity per unit volume calculated. &lt;br /&gt;
[[Image:errliq123456.png|frame|none|Plot of the heat capacity per volume against temperature for the simulated system.]]&lt;br /&gt;
&lt;br /&gt;
The input file used to calculate the heat capacity is given here:&lt;br /&gt;
[[File:Cv_origin.in]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with temperature as expected. As the temperature increases, more atoms begin to occupy the higher energy states, until almost all of the states are occupied. The energy gained from an increase in temperature would usually go towards increasing the energy level of an atom and not towards the kinetic energy, hence giving the atoms of our liquid a &#039;capacity to take in heat&#039; without changing temperature. If all the energy states are equally occupied, then the heat capacity will approach zero since there are no more higher energy states left for the atoms to occupy, and so the energy from an increase in temperature will go fully towards increasing the kinetic energy of the atoms.&lt;br /&gt;
&lt;br /&gt;
This is similar to the heat capacity predicted for a two-level system within the NVT ensemble, whereby the plot above is similar to the decay of the heat capacity of the two-level system after it passes the Schottky defect peak. Similar to these plots, the decay of the heat capacity of the two-level system is also due to the fact that both energy levels begin to get equally occupied at higher temperatures.&lt;br /&gt;
&lt;br /&gt;
The increase in heat capacity with increasing density is due to the fact that there are more atoms per unit volume if the density is higher. Therefore, more energy needs to be supplied in order to increase the temperature of a unit volume by one temperature unit, compared to the same volume containing less atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Some good suggestions, but remember that you are calculating a classical system which doesn&#039;t have a limited number of discrete energy levels.  Energy supplied to the system will go into both potential and kinetic energy.  More analysis would be needed to confirm this trend.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Radial Distribution Function ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The RDFs for a simulated LJ liquid, solid and gas were calculated and plotted as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq23.png|frame|none|Plot of the radial distribution functions of the three states]] &lt;br /&gt;
&lt;br /&gt;
The RDF for the solid has three distinct peaks at the beginning which can be used to find out about the coordination around an atom within the solid. The further peaks all fluctuate around an RDF value of 1, and their fluctuation signifies how the atoms in a solid are held more tightly in place and have long range order such that there is no smooth averaging of their positions. &lt;br /&gt;
&lt;br /&gt;
The RDF for a liquid features three peaks which correspond to the first, second and third hydration shells around an atom. The RDF does not approach zero between these peaks though, indicating that there is a chance of finding atoms between the hydration shells. After the peaks, the RDF averages out to a value of 1, since liquids have no long range order and thus on average the density of a shell a certain distance &#039;&#039;&#039;r&#039;&#039;&#039; from the center doesn&#039;t change. &lt;br /&gt;
&lt;br /&gt;
For the gas RDF, there is one peak after which it is subjected to the same averaging effect as the liquid RDF, since gases also lack long range order. The peak is probably due to the gas being surrounded by a sphere of other atoms held together by weak LJ attractive forces, and since there is only one peak rather than the three for a liquid RDF, this signifies that atoms in a gas have less of an attractive force on their neighbors than atoms in a liquid.&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid RDF can be used to determine the coordination of the nearest neighbors and second nearest neighbours. The integral of the radial distribution function allows us to physically count how many atoms are included within a volume defined by a certain radius &#039;&#039;&#039;r&#039;&#039;&#039; from the central atom, and it can be overlayed with the normal RDF to give a sense of the coordination number for each of the three peaks.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq233.png|frame|none|Plot of the solid RDF overlaid with the solid RDF integral]] &lt;br /&gt;
&lt;br /&gt;
The first peak in the RDF corresponds approximately to the integral value of 12 in the graph, indicating that the first peak of the solid RDF corresponds to a coordination with 12 atoms. The second, smaller peak in the RDF corresponds to the integral value of 18, and if the first 12 atoms are subtracted, this leaves 6 atoms coordinated to the atom from the second RDF peak.&lt;br /&gt;
&lt;br /&gt;
Before deducing the coordination number of the third peak, a diagram can be drawn of the FCC lattice to show which lattice sites the three peaks could correspond to:&lt;br /&gt;
&lt;br /&gt;
[[Image:crystda2m.png|frame|none|Diagram of an FCC lattice showcasing the coordination of the nearest neighbours]] &lt;br /&gt;
&lt;br /&gt;
The first RDF peak corresponds do the red dots which form the 12 nearest neighbors to the central atom. The second peak corresponds to the blue dots which form the 6 second nearest neighbours. Finally, the third peak corresponds to the green dots forming the next 24 nearest neighbors. Therefore, the coordination number of the third peak should be 24, and this would correspond to a value of 42 for the integral plot, which can just barely be seen above the third peak since the line is sloping rather than forming a plateau. &lt;br /&gt;
&lt;br /&gt;
The lattice spacing is denoted by the distance to the second nearest neighbors as indicated by the diagram. Therefore, the lattice spacing is &#039;&#039;&#039;r ~ 1.5&#039;&#039;&#039; since this is the r value for the second RDF peak corresponding to the second nearest neighbors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice diagram to show which atoms are responsible for the first 3 peaks and good explanation of the differences between the RDFs.  Could you have calculated the lattice parameter from the first and third peaks as well, by expressing the distance to these atoms in terms of the lattice parameter, and then calculated an average?/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;In order to get a measure of how much our atoms move around in our simulation, we could calculate the diffusion coefficient. The diffusion coefficient can be calculated using the &#039;&#039;&#039;mean squared displacement&#039;&#039;&#039;, and this was calculated for simulations of an LJ solid, liquid and gas. The MSD was then plotted against time:&lt;br /&gt;
[[Image:errliq2123.png|frame|none|Plot of the MSD with time for the three states]] &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is directly proportional to the gradient of the MSD with time. With this knowledge, we can make estimates for the diffusion coefficient &#039;&#039;&#039;D&#039;&#039;&#039;.&lt;br /&gt;
# For a solid, the mean squared displacement is very low (0.02) and stays this way even after a certain amount of time. This is to be expected since atoms in a solid don&#039;t displace far from their original position and can only vibrate in place. Since the MSD doesn&#039;t really change with time, it has an almost zero gradient, which indicates a &#039;&#039;&#039;diffusion coefficient close to zero&#039;&#039;&#039;, which is also expected because solid atoms rarely (through defects) diffuse throughout a lattice. &lt;br /&gt;
# For a liquid, the MSD rises with time, since liquid atoms can flow around each other. Therefore, they can eventually reach a displacement quite far from their original positions. The gradient of the plot is estimated to be 0.5, which leads to the following calculation for the diffusion coefficient:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(0.5)=0.0833&amp;lt;/math&amp;gt;&lt;br /&gt;
# The MSD of an atom in a gas rises more quickly than that of an atom in a liquid, since atoms are free to move around in space within a gas (apart from colliding with other atoms). Therefore, they can very quickly stray far from their original position. If we estimate the gradient from the linear portion of the graph, then: &amp;lt;math&amp;gt;D_{gas}=\frac{1}{6}\frac{140-120}{9.77-8.77}=3.33&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also estimated for simulations of the three phases involving one million atoms.&lt;br /&gt;
[[Image:errliq212123.png|frame|none|Plot of the MSD with time for the three states using a simulation of one million atoms for each phase]] &lt;br /&gt;
# The diffusion coefficient of the solid is once again approximately zero since the gradient of the MSD against time is roughly zero in the plot.&lt;br /&gt;
# The diffusion coefficient for the liquid has increased slightly, whereby we can calculate:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(5.05/10)=0.0842&amp;lt;/math&amp;gt;. &lt;br /&gt;
# The diffusion coefficient for the gas is approximately the same as the value calculated for the simulation with less atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It&#039;s more accurate to calculate the gradient of the MSD by fitting the linear part to a straight line, rather than just using 2 data points.  Why does the gas phase MSD take longer to reach the linear (diffusive) regime, what does the curved part of the graph represent?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Using the equation for the displacement of a simple harmonic oscillator, we can evaluate the &#039;&#039;&#039;velocity autocorrelation function&#039;&#039;&#039; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A^2\omega^2 \sin(\omega t+\phi)\sin(\omega (t+\tau) + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \frac{1}{2} (\cos(\omega \tau)-\cos(2\omega t + 2\phi +\omega\tau))\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} (1-\cos(2\omega t+2\phi))\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We evaluate the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t + 2\phi +\omega\tau))|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t+2\phi))|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals involving the sin functions are always bounded to be between -1 and 1, so the much larger &amp;lt;math&amp;gt;t|^{\infty}_{-\infty}&amp;lt;/math&amp;gt; term will dominate the fraction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You don&#039;t need to perform any of the integration if you remember that the integral of an odd function is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function for the SHO, LJ liquid and solid can be compared as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112123.png|frame|none|Plot of various VACFs plotted against timestep]] &lt;br /&gt;
&lt;br /&gt;
The VACF is a measure of how much the current velocity of an atom affects its future velocity (how much they correlate). The minima in the solid and liquid VACFs denote oscillatory behavior for the atoms, whereby the solid phase atoms oscillate in place and reverse their velocities at the end of each oscillation. That is why there are still minima and maxima present for the solid VACF at later times, because the velocity of the atom does have an effect on its future velocity due to influencing its vibration in place. For the liquid phase, the atoms are allowed to flow around each other and diffuse throughout the system, so the correlation rapidly decays exponentially with time since the initial velocity has no effect on the later velocities. There is only one minimum corresponding to one occurrence of velocity reversal for a liquid phase atom, which may correspond to a single collision with another atom before diffusing in the opposite direction. Since liquid atoms don&#039;t vibrate in place, there wouldn&#039;t be any further minima in the VACF. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator seems to have the highest correlation in velocity with time, and its VACF is very different to that of an LJ liquid and solid because the SHO uses a symmetric harmonic potential rather than the anharmonic LJ potential. The oscillator can&#039;t diffuse anywhere since it is trapped in the potential well, and its velocities are more correlated than those of an LJ solid because the potential well is symmetric and not subject to more than one kind of interaction, such as the repulsion and attraction simulated by the LJ potential. &lt;br /&gt;
&lt;br /&gt;
Therefore, the vibrations of the SHO are more ordered and restricted to a single dimension than the vibrations of the LJ solid atoms, and the VACF for the SHO is strictly periodic with symmetric minima that, unlike the minima of the LJ solid, never dampen.&lt;br /&gt;
&lt;br /&gt;
The LJ solid could actually be considered a dampened oscillator, since all its atoms are vibrating in place, but since the LJ potential is asymmetric, there is more chance for a random pair of atomic interactions to be different from the last, causing future velocities to &#039;lose their memory&#039; of the initial velocity. Hence the LJ solid VACF is still lower than that of a perfect oscillator (but still higher than the VACF for a liquid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Decorrelation is caused by collisions which randomise the particle velocities.  The lack of collisions in the harmonic oscillator means that the VACF never decays.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The trapezium rule was used to calculate the running integral of the VACF wrt time. The result was then plotted against time for the solid, liquid and gas simulations.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq22115124155112123.png|frame|none|Plot of the running integral of the VACF against time for the three phases]]Similar to the MSD, the diffusion coefficients can be estimated from these running integrals. Since the relation of the VACF to the diffusion coefficient is given as:&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it is evident that the value of the running integral at &amp;lt;math&amp;gt;t=/infty&amp;lt;/math&amp;gt; will be equal to the diffusion coefficient multiplied by three. In practice, we simply need to observe when the running integrals in these plots converge to a certain value, and divide the value by three to get the diffusion coefficient.&lt;br /&gt;
# For the &#039;&#039;&#039;solid&#039;&#039;&#039;, the running integral converges to zero, so the &#039;&#039;&#039;diffusion coefficient must be zero&#039;&#039;&#039;, as expected of atoms which can only vibrate in place.&lt;br /&gt;
# For the &#039;&#039;&#039;liquid&#039;&#039;&#039;, the running integral converges to a value of about 0.3, which then gives a &#039;&#039;&#039;diffusion coefficient of 0.1 &#039;&#039;&#039;after dividing by three. This is in good agreement with the previously calculated diffusion coefficient of 0.0833 using the MSD.&lt;br /&gt;
# For the &#039;&#039;&#039;gas&#039;&#039;&#039;, the running integral seems to just converge at a value of about 10, which gives a &#039;&#039;&#039;diffusion coefficient of 3.33&#039;&#039;&#039;. This is almost exactly the same as the value calculated using the MSD, and as expected, the diffusion coefficient of a gas is the highest among the phases, with liquids being in between solids and gas.&lt;br /&gt;
Similar to the case of MSD, the diffusion coefficient was also estimated using the running integrals from simulations involving one million atoms.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112647123.png|frame|none|Plot of the running integral of the VACF against time for the three phases using one million atoms for the simulation]] &lt;br /&gt;
&lt;br /&gt;
For the solid and gaseous simulations, the estimate of the diffusion coefficient will be very similar to that of the simulations that used less atoms.&lt;br /&gt;
* For the liquid simulation using one million atoms, the noise has at least been smoothed out and we can make out a clearer convergence of the running integral at about 0.27. This gives a value of &#039;&#039;&#039;0.09 for the diffusion coefficient&#039;&#039;&#039;.&lt;br /&gt;
The largest source of error in calculating &#039;&#039;&#039;D&#039;&#039;&#039; from the VACF is possibly from the use of the trapezium rule, which is one of the simplest forms of numerical integration. A more precise method, such as Simpson&#039;s rule which uses fitting quadratics, could lead to an estimate of the diffusion coefficient with a smaller error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good analysis.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=596825</id>
		<title>Talk:Mod:wern-liquidsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=596825"/>
		<updated>2017-03-08T16:08:32Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: .&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= The Simulation of Simple Liquids through Molecular Dynamics =&lt;br /&gt;
== Theory of Molecular Dynamics ==&lt;br /&gt;
Molecular dynamics involves simulating how particles in a system move with time, by calculating the relevant velocities, forces and displacements of the particles. In the ergodic hypothesis, whereby the time-average of the system is equivalent to the average of a large number of sampled configurations of the system, molecular dynamics would be able to simulate the time-average part of this hypothesis.&lt;br /&gt;
&lt;br /&gt;
In this experiment, we will use molecular dynamics to simulate a simple liquid governed by Lennard-Jones interactions. The algorithm for calculating the various dynamics of the particles is called the Velocity-Verlet algorithm, and it uses the approximation that the particles obey Newton&#039;s Laws (behave classically).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK : &#039;&#039;&#039;The accuracy of the algorithm was tested by using it to calculate the various dynamics and energies of a simple harmonic oscillator, and comparing it against the exact solutions. &lt;br /&gt;
&lt;br /&gt;
[[Image:errliq10.png|frame|none|Comparison of the displacement functions calculated analytically and by the algorithm.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen, the function calculated by the algorithm (red line) almost has a complete overlap with the analytical function for the SHO displacement (dotted line). This indicates that our algorithm (the Velocity-Verlet) is quite accurate at simulating this system numerically (and at the timestep of 0.1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For the timestep of 0.1, the peaks of the error between the displacement calculated by the algorithm and the exact displacement were seen to rise in height linearly with time, as shown by the plot below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq102.png|frame|none|The upper plot shows the error between the analytical and algorithmic values of the displacement. The lower plot shows that a linear line can be fitted through the heights of the error maxima]]&lt;br /&gt;
&lt;br /&gt;
The equation of the linear fit is shown, and it can be seen that it has a high R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value, indicating that the points correlate with a linear fit very well.&lt;br /&gt;
&lt;br /&gt;
The linear fit was made by estimating the position of the error maxima, and the table of the estimates is given below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Time (estimate)&lt;br /&gt;
  |Error Height&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |2&lt;br /&gt;
  |0.000758457&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |5&lt;br /&gt;
  |0.001999391&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |8&lt;br /&gt;
  |0.00330076&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |11&lt;br /&gt;
  |0.00458839&lt;br /&gt;
&lt;br /&gt;
 |-&lt;br /&gt;
  |14&lt;br /&gt;
  |0.00578735&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Overall, the fit indicates that as time passes, the discrepancy between the algorithmic and analytical methods would increase. However, the gradient for the change is quite small, whereby each increment of time increases the error by roughly 0.0004. Therefore, even if we were to run 1000 iterations of a timestep of 0.1, we would reach a total time of 100, which would give an error of 100 × 0.0004 = &#039;&#039;&#039;0.04&#039;&#039;&#039;. Compared to the maximum displacement of the oscillator, which is 1.0, this is still only an error of ~ 4%. Therefore, it can be concluded that the error increases at such a slow rate with time that running a sizable amount of timesteps would still allow the simulation to remain within a reasonable approximation to the exact solution. Of course, this applies only to a timestep of 0.1, and the next task explores the effects of changing timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The displacement for a harmonic oscillator can be described by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator can be given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;TE=\frac{1}{2}mv^2+\frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are all equal to one for the displacement equation, then the analytical total energy is simply half the amplitude squared, which would be &#039;&#039;&#039;0.5&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Upon choosing different timesteps, the total energy of the algorithm solution oscillated between the analytical total energy and a lower value. It was seen that &#039;&#039;&#039;a timestep equal to or less than 0.2 would not change the total energy by more than 1%. &#039;&#039;&#039;The plot of the total energy of the Velocity-Verlet algorithm solution against time with a timestep of 0.2 is given below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq3.png|frame|none|Oscillating total energy with time of the algorithm solution. The lower bound never reaches more than 1% below the analytical total energy.]]It is important to monitor the total energy of a system you are modelling numerically because:&lt;br /&gt;
* Comparing the numerical total energy values with the analytical values can tell you how accurate your algorithm is at modelling the system.&lt;br /&gt;
* One needs to observe whether the total energy has converged towards a constant average value, which would indicate that the system has reached thermodynamic equilibrium at its lowest energy state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;To simulate the interactions between atoms in our simple liquid, the Lennard-Jones potential was used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to attain a potential equal to zero, the two terms in the brackets must equal each other.&lt;br /&gt;
&lt;br /&gt;
The separation&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;at which the potential energy is zero is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at a given separation is attained after differentiating the potential equation wrt&amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(r) = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(\sigma) = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;is when&amp;lt;math&amp;gt;F=0&amp;lt;/math&amp;gt;. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=2^{1/6}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The potential energy at the equilibrium separation is given by:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)=4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential was evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int\phi\left(r\right) dr= 4\epsilon \left( \frac{\sigma^{6}}{5r^{5}} - \frac{\sigma^{12}}{11r^{11}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixing &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;to one, the following integrals were evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2\sigma}\phi\left(r\right) dr= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2.5\sigma}\phi\left(r\right) dr= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{3\sigma}\phi\left(r\right) dr= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, but you could simplify your answer for the force at r0.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; In 1 mL of water under standard conditions, the density is approximately 1 g mL&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, and the Mr of water is 18. The number of molecules can then be calculated:&lt;br /&gt;
&lt;br /&gt;
1/18 × 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;3.35 × 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; molecules&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Similarly the volume occupied by just 10000 water molecules can be calculated as:&lt;br /&gt;
&lt;br /&gt;
10000 / ( 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; ) × 18 = &#039;&#039;&#039;3.00 × 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since the volume simulated by just 10000 molecules is extremely small, periodic boundary conditions are imposed in order to better approximate bulk liquids. In such a system, an atom at position &#039;&#039;&#039;(0.5, 0.5, 0.5)&#039;&#039;&#039; in a cubic simulation box running from (0, 0, 0) to (1, 1, 1) which moves &#039;&#039;&#039;along a vector (0.7, 0.6, 0.2)&#039;&#039;&#039; would &#039;&#039;&#039;reach the position (0.2, 0.1, 0.7)&#039;&#039;&#039; after applying the periodic boundary conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Reduced units will also be used for the thermodynamic variables in the simulation.  &lt;br /&gt;
* Using the Lennard-Jones parameters for argon, if the LJ cutoff occurs at &#039;&#039;&#039;r* = 3.2, &#039;&#039;&#039;it is &#039;&#039;&#039;r = 1.088 nm&#039;&#039;&#039; in real units (σ&amp;lt;sub&amp;gt;Ar&amp;lt;/sub&amp;gt; = 0.34 nm). &lt;br /&gt;
&lt;br /&gt;
* The well-depth is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;as calculated before, and its value in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; can be calculated as:&lt;br /&gt;
&lt;br /&gt;
ⲉ / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120 K&lt;br /&gt;
&lt;br /&gt;
ⲉ = 1.656 × 10&amp;lt;sup&amp;gt;-21&amp;lt;/sup&amp;gt; J&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ⲉ = 0.997 kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* The reduced temperature &#039;&#039;&#039;T* = 1.5&#039;&#039;&#039; in real units would be&#039;&#039;&#039;:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T&#039;&#039;&#039; = 1.5 × ⲉ / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= &#039;&#039;&#039;180 K&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
In order to start our algorithm we need to assign the initial positions of our atoms. However, liquids don&#039;t have long range order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Though assigning random positions to the atoms inside the simulation box would achieve the lower degree of long range order characteristic of liquids, this could cause problems. If you have two atoms generated very close to each other for example, the LJ potential will approach infinity at the small separation, generating a large repulsive force between them. If the simulation randomly generates many atom pairs too close to each other, most of the atoms in the system will fly apart from each other at very high speeds due to experiencing strong repulsive forces (i.e. the entire system will fly apart). This is not characteristic of a flowing liquid whereby the atoms are at a separation whereby they are still held together by attractive forces. Or rather, liquids don&#039;t spontaneously fly apart, but instead flow.&lt;br /&gt;
&lt;br /&gt;
Therefore, the simulation will start from a simple cubic lattice. If simulated for a long enough time under the correct potentials, the atoms will rearrange into positions more reminiscent of a liquid (i.e. we have melted the crystal)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces make the simulation unstable and can cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Within the input file, the following command creates a simple cubic lattice (one lattice point per unit cell), with a number density of 0.8.&lt;br /&gt;
 lattice sc 0.8&lt;br /&gt;
The output file indicates that the distance between the LPs is 1.07722 (reduced units).&lt;br /&gt;
 Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
Within a cubic lattice, the LPs all occupy the corners of a cube, but the cube itself contains just one LP (due to sharing the LP with other cubes). Therefore the number density can be calculated as:&lt;br /&gt;
&lt;br /&gt;
1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;0.8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This indeed corresponds to the above input.&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 LPs for every cube, since the corner LPs are still present (and contribute 1/8 of an LP) and the facial LPs each contribute 1/2 of an LP. For a face-centered cubic lattice with a number density of 1.2, the side length will be (in reduced units):&lt;br /&gt;
&lt;br /&gt;
(4 / 1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;1.49380&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For a face-centered cubic lattice, we assume that the following commands were inputted:&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
There would be 1000 unit cells contained within the entire box. Since a face-centered cubic lattice has 4 LPs per unit cell, there would be &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; of type 1 within this simulation box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Within the LAMMPS script, the properties of the atoms and the interactions have to be specified through the following parameters:&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;
* The first line sets the masses of the atoms belonging to Type 1 to 1.0 (reduced units). Since a pure liquid is being simulated, only one atom type is present (Type 1).&lt;br /&gt;
* The second line adds pairwise LJ potential interactions between the atoms, whereby the interaction is calculated only if the atoms have a distance between them which is lower than or equal to 3.0 (reduced units). This cutoff or &#039;&#039;&#039;truncation&#039;&#039;&#039; of the potential is justified, since the integral of the LJ potential between a separation distance of 3.0 and positive infinity was previously calculated to be a small number. This signifies that interactions between atoms at a distance of 3.0 or higher are very small, and that they can be ignored within the simulation.&lt;br /&gt;
* The third line sets the two coefficients of the LJ potential (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;and&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;) for a pair of atoms. The two asterisks indicate that the coefficients will be applied to the LJ potential of &#039;&#039;all&#039;&#039; the pair interactions between the atoms (the equivalent of writing &amp;lt;math&amp;gt; \sum_i^N \sum_{i \neq j}^{N}&amp;lt;/math&amp;gt;). The coefficients are set to 1.0 in this case.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since &amp;lt;math&amp;gt;x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are being specified for this simulation, the Velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The following lines were typed into the input script&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The second line creates a variable named &#039;timestep&#039; and assigns it a value of 0.001. This way, any subsequent line can easily call the variable&#039;s value again by typing ${timestep}. This allows for the timestep value to be more easily manipulated and stored in memory so that it can be easily accessed throughout the script. Furthermore, if the value needs to be changed, only the first line which created the variable needs to have the value changed and all subsequent variable calls will change value as well. This is a lot more effective than simply assigning the same value repeatedly to each function call.&lt;br /&gt;
&lt;br /&gt;
The purpose of the subsequent lines is to define more variables, such as the number of steps, to be used later as well. Since defining these variables relies on the values of previous variables, if the value of the previous variables were to change, then these variables would also scale appropriately with the change, which is another advantage of using variables.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;After running the simulation, plots of the energy, temperature and pressure of the simulated liquid system against time were made for when a timestep of 0.001 was used. Additionally, a plot of the energy of the system against time for different timestep sizes was also made:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq123.png|frame|none|Plots of various thermodynamic variables with time. A plot of the energy of the system against time for various timestep sizes is included at the bottom left.]]&lt;br /&gt;
&lt;br /&gt;
The system simulated at a timestep of 0.001 can be seen to reach an equilibrium in energy, temperature and pressure very quickly (less than 5.0 time units into a simulation that simulates 100 time units) as all three values rapidly reach an oscillation around an average value.&lt;br /&gt;
&lt;br /&gt;
Using the bottom left plot, it can be seen that the timestep of 0.0025 is the largest timestep that gives acceptable results, since it is larger than the 0.001 timestep but is seen to oscillate approximately around the same average total energy as that of the 0.001 timestep system. The larger timesteps may still give a stable average total energy (excluding 0.015), but these are higher than the average energy indicated by the timestep of 0.0025, which indicates that the higher timesteps have simulated a system which hasn&#039;t converged to the lowest energy state, which is the equilibrium state we desire.&lt;br /&gt;
&lt;br /&gt;
Particularly, choosing the largest timestep of 0.015 is a particularly bad choice because it doesn&#039;t even give a stable average total energy within the time given. Instead, it gives a total energy that increases further with time, which definitely indicates that the simulated system is not at an equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, average total energy should not depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions (the NpT ensemble) ==&lt;br /&gt;
&#039;&#039;&#039;TASK (Choosing 10 phase points in the NpT ensemble): &#039;&#039;&#039;From the previous simulation under the NVE ensemble, it was seen that a timestep of 0.0025 was the largest that still gave a convergent energy for the system. The average temperature and pressure of the system under the NVE ensemble at a timestep of 0.001 was also calculated after cutting off the first 100 data points (there were 4000 data points for the temperature and pressure, so excluding the first 100 would remove the transient behavior while still leaving enough data points to calculate a reliable average). The following are the averages:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T* = 1.256&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;P* = 2.615&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From these averages indicated by the NVE ensemble, it can be seen that varying the pressure around the value of 2.6 would give reasonable results within the NpT ensemble. Ten simulations of the NpT ensemble were created, whereby a temperature range of 1.6, 1.8, 2.0, 2.2 and 2.4 was chosen and measured at the pressures of 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The temperature of the simulated system can be calculated using the equipartition theorem. However, the simulated temperature may differ from that of the target temperature, and so a factor of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be multiplied with the velocities for the sum of the kinetic energy of the atoms in order to equalize with the target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. Through this relation, one can solve for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2}Nk_BT=\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i  v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2=\frac{\frac{3}{2} N k_B \mathfrak{T}} {\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T} }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The following commands were given to adjust how many times the state of the system was measured.&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&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;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
On the&lt;br /&gt;
second last line, the values 100, 1000 and 100000 signify the way in which the&lt;br /&gt;
average of a certain variable is calculated. Specifically, there will be 1000&lt;br /&gt;
values of the temperature and other variables used to calculate the average&lt;br /&gt;
value on timestep 100000. Since the simulation only runs for 100000 timesteps,&lt;br /&gt;
there will only be one average calculated (if the value of 100000 was changed&lt;br /&gt;
to 10000 for example, there would be ten average values calculated at every&lt;br /&gt;
10000th timestep). The value of 100 indicates that the 1000 values used&lt;br /&gt;
to calculate the average will be taken from every 100 timesteps before the&lt;br /&gt;
100000th timestep. &lt;br /&gt;
&lt;br /&gt;
In other&lt;br /&gt;
words, for our simulation there will be 1000 values chosen from 1000 timesteps,&lt;br /&gt;
and the first four timesteps of the 1000 timesteps are 100000, 99900, 99800,&lt;br /&gt;
and 99700. This decrease by 100 timesteps will continue until we have the values from 1000 timesteps. The values sampled will then be used to calculate the average at the&lt;br /&gt;
100000th timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The densities of the various simulations were plotted against the corresponding temperatures and pressures with errors. Additionally, plots of the ideal gas density against temperature were also made for comparison.&lt;br /&gt;
[[Image:errliq12345.png|frame|none|Plots of the density against temperature for the NpT simulations at two different pressures. The lower graph also includes the equivalent plot using the ideal gas equation for comparison.]]The simulated densities are much lower than the equivalent densities plotted by the ideal gas law. This is because the ideal gas doesn&#039;t take into account any interactive forces between atoms, so atoms could cluster together as close as they want without any interaction occurring, allowing for more dense systems. Our simulation uses the LJ potential to supplie interactive forces between atoms, and it is the large repulsive term in the LJ potential equation that dominates the behavior of the LJ liquid. Since the potential and subsequent repulsive force would increase rapidly with decreasing separation, the atoms in our simulation will always keep a larger distance apart from each other within a certain volume, which would give them a lower density than the ideal gas at the same pressure and temperature.  &lt;br /&gt;
&lt;br /&gt;
This discrepancy appears to increase at higher pressures, since the height separation between the simulation plot and ideal gas plot at a pressure of 3.0 is higher than that at 2.5. This is because higher pressures for the ideal gas would continue to compress the atoms closer together without any hindrance from repulsive forces, while our LJ liquid does not change as much in density due to pressure since the repulsive forces are still holding the atoms at a certain distance apart.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation, how does the discrepancy between simulation and ideal gas results change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Heat Capacity ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The simulation was run using the NVT ensemble so as to calculate the heat capacity of the system. The plot below shows the simulation being run through a range of temperatures and two densities, with the heat capacity per unit volume calculated. &lt;br /&gt;
[[Image:errliq123456.png|frame|none|Plot of the heat capacity per volume against temperature for the simulated system.]]&lt;br /&gt;
&lt;br /&gt;
The input file used to calculate the heat capacity is given here:&lt;br /&gt;
[[File:Cv_origin.in]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with temperature as expected. As the temperature increases, more atoms begin to occupy the higher energy states, until almost all of the states are occupied. The energy gained from an increase in temperature would usually go towards increasing the energy level of an atom and not towards the kinetic energy, hence giving the atoms of our liquid a &#039;capacity to take in heat&#039; without changing temperature. If all the energy states are equally occupied, then the heat capacity will approach zero since there are no more higher energy states left for the atoms to occupy, and so the energy from an increase in temperature will go fully towards increasing the kinetic energy of the atoms.&lt;br /&gt;
&lt;br /&gt;
This is similar to the heat capacity predicted for a two-level system within the NVT ensemble, whereby the plot above is similar to the decay of the heat capacity of the two-level system after it passes the Schottky defect peak. Similar to these plots, the decay of the heat capacity of the two-level system is also due to the fact that both energy levels begin to get equally occupied at higher temperatures.&lt;br /&gt;
&lt;br /&gt;
The increase in heat capacity with increasing density is due to the fact that there are more atoms per unit volume if the density is higher. Therefore, more energy needs to be supplied in order to increase the temperature of a unit volume by one temperature unit, compared to the same volume containing less atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Some good suggestions, but remember that you are calculating a classical system which doesn&#039;t have a limited number of discrete energy levels.  Energy supplied to the system will go into both potential and kinetic energy.  More analysis would be needed to confirm this trend.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== The Radial Distribution Function ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The RDFs for a simulated LJ liquid, solid and gas were calculated and plotted as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq23.png|frame|none|Plot of the radial distribution functions of the three states]] &lt;br /&gt;
&lt;br /&gt;
The RDF for the solid has three distinct peaks at the beginning which can be used to find out about the coordination around an atom within the solid. The further peaks all fluctuate around an RDF value of 1, and their fluctuation signifies how the atoms in a solid are held more tightly in place and have long range order such that there is no smooth averaging of their positions. &lt;br /&gt;
&lt;br /&gt;
The RDF for a liquid features three peaks which correspond to the first, second and third hydration shells around an atom. The RDF does not approach zero between these peaks though, indicating that there is a chance of finding atoms between the hydration shells. After the peaks, the RDF averages out to a value of 1, since liquids have no long range order and thus on average the density of a shell a certain distance &#039;&#039;&#039;r&#039;&#039;&#039; from the center doesn&#039;t change. &lt;br /&gt;
&lt;br /&gt;
For the gas RDF, there is one peak after which it is subjected to the same averaging effect as the liquid RDF, since gases also lack long range order. The peak is probably due to the gas being surrounded by a sphere of other atoms held together by weak LJ attractive forces, and since there is only one peak rather than the three for a liquid RDF, this signifies that atoms in a gas have less of an attractive force on their neighbors than atoms in a liquid.&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid RDF can be used to determine the coordination of the nearest neighbors and second nearest neighbours. The integral of the radial distribution function allows us to physically count how many atoms are included within a volume defined by a certain radius &#039;&#039;&#039;r&#039;&#039;&#039; from the central atom, and it can be overlayed with the normal RDF to give a sense of the coordination number for each of the three peaks.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq233.png|frame|none|Plot of the solid RDF overlaid with the solid RDF integral]] &lt;br /&gt;
&lt;br /&gt;
The first peak in the RDF corresponds approximately to the integral value of 12 in the graph, indicating that the first peak of the solid RDF corresponds to a coordination with 12 atoms. The second, smaller peak in the RDF corresponds to the integral value of 18, and if the first 12 atoms are subtracted, this leaves 6 atoms coordinated to the atom from the second RDF peak.&lt;br /&gt;
&lt;br /&gt;
Before deducing the coordination number of the third peak, a diagram can be drawn of the FCC lattice to show which lattice sites the three peaks could correspond to:&lt;br /&gt;
&lt;br /&gt;
[[Image:crystda2m.png|frame|none|Diagram of an FCC lattice showcasing the coordination of the nearest neighbours]] &lt;br /&gt;
&lt;br /&gt;
The first RDF peak corresponds do the red dots which form the 12 nearest neighbors to the central atom. The second peak corresponds to the blue dots which form the 6 second nearest neighbours. Finally, the third peak corresponds to the green dots forming the next 24 nearest neighbors. Therefore, the coordination number of the third peak should be 24, and this would correspond to a value of 42 for the integral plot, which can just barely be seen above the third peak since the line is sloping rather than forming a plateau. &lt;br /&gt;
&lt;br /&gt;
The lattice spacing is denoted by the distance to the second nearest neighbors as indicated by the diagram. Therefore, the lattice spacing is &#039;&#039;&#039;r ~ 1.5&#039;&#039;&#039; since this is the r value for the second RDF peak corresponding to the second nearest neighbors.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice diagram to show which atoms are responsible for the first 3 peaks and good explanation of the differences between the RDFs.  Could you have calculated the lattice parameter from the first and third peaks as well, by expressing the distance to these atoms in terms of the lattice parameter, and then calculated an average?/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;In order to get a measure of how much our atoms move around in our simulation, we could calculate the diffusion coefficient. The diffusion coefficient can be calculated using the &#039;&#039;&#039;mean squared displacement&#039;&#039;&#039;, and this was calculated for simulations of an LJ solid, liquid and gas. The MSD was then plotted against time:&lt;br /&gt;
[[Image:errliq2123.png|frame|none|Plot of the MSD with time for the three states]] &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is directly proportional to the gradient of the MSD with time. With this knowledge, we can make estimates for the diffusion coefficient &#039;&#039;&#039;D&#039;&#039;&#039;.&lt;br /&gt;
# For a solid, the mean squared displacement is very low (0.02) and stays this way even after a certain amount of time. This is to be expected since atoms in a solid don&#039;t displace far from their original position and can only vibrate in place. Since the MSD doesn&#039;t really change with time, it has an almost zero gradient, which indicates a &#039;&#039;&#039;diffusion coefficient close to zero&#039;&#039;&#039;, which is also expected because solid atoms rarely (through defects) diffuse throughout a lattice. &lt;br /&gt;
# For a liquid, the MSD rises with time, since liquid atoms can flow around each other. Therefore, they can eventually reach a displacement quite far from their original positions. The gradient of the plot is estimated to be 0.5, which leads to the following calculation for the diffusion coefficient:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(0.5)=0.0833&amp;lt;/math&amp;gt;&lt;br /&gt;
# The MSD of an atom in a gas rises more quickly than that of an atom in a liquid, since atoms are free to move around in space within a gas (apart from colliding with other atoms). Therefore, they can very quickly stray far from their original position. If we estimate the gradient from the linear portion of the graph, then: &amp;lt;math&amp;gt;D_{gas}=\frac{1}{6}\frac{140-120}{9.77-8.77}=3.33&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also estimated for simulations of the three phases involving one million atoms.&lt;br /&gt;
[[Image:errliq212123.png|frame|none|Plot of the MSD with time for the three states using a simulation of one million atoms for each phase]] &lt;br /&gt;
# The diffusion coefficient of the solid is once again approximately zero since the gradient of the MSD against time is roughly zero in the plot.&lt;br /&gt;
# The diffusion coefficient for the liquid has increased slightly, whereby we can calculate:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(5.05/10)=0.0842&amp;lt;/math&amp;gt;. &lt;br /&gt;
# The diffusion coefficient for the gas is approximately the same as the value calculated for the simulation with less atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It&#039;s more accurate to calculate the gradient of the MSD by fitting the linear part to a straight line, rather than just using 2 data points.  Why does the gas phase MSD take longer to reach the linear (diffusive) regime, what does the curved part of the graph represent?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Using the equation for the displacement of a simple harmonic oscillator, we can evaluate the &#039;&#039;&#039;velocity autocorrelation function&#039;&#039;&#039; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A^2\omega^2 \sin(\omega t+\phi)\sin(\omega (t+\tau) + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \frac{1}{2} (\cos(\omega \tau)-\cos(2\omega t + 2\phi +\omega\tau))\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} (1-\cos(2\omega t+2\phi))\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We evaluate the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t + 2\phi +\omega\tau))|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t+2\phi))|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals involving the sin functions are always bounded to be between -1 and 1, so the much larger &amp;lt;math&amp;gt;t|^{\infty}_{-\infty}&amp;lt;/math&amp;gt; term will dominate the fraction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You don&#039;t need to perform any of the integration if you remember that the integral of an odd function is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function for the SHO, LJ liquid and solid can be compared as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112123.png|frame|none|Plot of various VACFs plotted against timestep]] &lt;br /&gt;
&lt;br /&gt;
The VACF is a measure of how much the current velocity of an atom affects its future velocity (how much they correlate). The minima in the solid and liquid VACFs denote oscillatory behavior for the atoms, whereby the solid phase atoms oscillate in place and reverse their velocities at the end of each oscillation. That is why there are still minima and maxima present for the solid VACF at later times, because the velocity of the atom does have an effect on its future velocity due to influencing its vibration in place. For the liquid phase, the atoms are allowed to flow around each other and diffuse throughout the system, so the correlation rapidly decays exponentially with time since the initial velocity has no effect on the later velocities. There is only one minimum corresponding to one occurrence of velocity reversal for a liquid phase atom, which may correspond to a single collision with another atom before diffusing in the opposite direction. Since liquid atoms don&#039;t vibrate in place, there wouldn&#039;t be any further minima in the VACF. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator seems to have the highest correlation in velocity with time, and its VACF is very different to that of an LJ liquid and solid because the SHO uses a symmetric harmonic potential rather than the anharmonic LJ potential. The oscillator can&#039;t diffuse anywhere since it is trapped in the potential well, and its velocities are more correlated than those of an LJ solid because the potential well is symmetric and not subject to more than one kind of interaction, such as the repulsion and attraction simulated by the LJ potential. &lt;br /&gt;
&lt;br /&gt;
Therefore, the vibrations of the SHO are more ordered and restricted to a single dimension than the vibrations of the LJ solid atoms, and the VACF for the SHO is strictly periodic with symmetric minima that, unlike the minima of the LJ solid, never dampen.&lt;br /&gt;
&lt;br /&gt;
The LJ solid could actually be considered a dampened oscillator, since all its atoms are vibrating in place, but since the LJ potential is asymmetric, there is more chance for a random pair of atomic interactions to be different from the last, causing future velocities to &#039;lose their memory&#039; of the initial velocity. Hence the LJ solid VACF is still lower than that of a perfect oscillator (but still higher than the VACF for a liquid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Decorrelation is caused by collisions which randomise the particle velocities.  The lack of collisions in the harmonic oscillator means that the VACF never decays.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The trapezium rule was used to calculate the running integral of the VACF wrt time. The result was then plotted against time for the solid, liquid and gas simulations.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq22115124155112123.png|frame|none|Plot of the running integral of the VACF against time for the three phases]]Similar to the MSD, the diffusion coefficients can be estimated from these running integrals. Since the relation of the VACF to the diffusion coefficient is given as:&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it is evident that the value of the running integral at &amp;lt;math&amp;gt;t=/infty&amp;lt;/math&amp;gt; will be equal to the diffusion coefficient multiplied by three. In practice, we simply need to observe when the running integrals in these plots converge to a certain value, and divide the value by three to get the diffusion coefficient.&lt;br /&gt;
# For the &#039;&#039;&#039;solid&#039;&#039;&#039;, the running integral converges to zero, so the &#039;&#039;&#039;diffusion coefficient must be zero&#039;&#039;&#039;, as expected of atoms which can only vibrate in place.&lt;br /&gt;
# For the &#039;&#039;&#039;liquid&#039;&#039;&#039;, the running integral converges to a value of about 0.3, which then gives a &#039;&#039;&#039;diffusion coefficient of 0.1 &#039;&#039;&#039;after dividing by three. This is in good agreement with the previously calculated diffusion coefficient of 0.0833 using the MSD.&lt;br /&gt;
# For the &#039;&#039;&#039;gas&#039;&#039;&#039;, the running integral seems to just converge at a value of about 10, which gives a &#039;&#039;&#039;diffusion coefficient of 3.33&#039;&#039;&#039;. This is almost exactly the same as the value calculated using the MSD, and as expected, the diffusion coefficient of a gas is the highest among the phases, with liquids being in between solids and gas.&lt;br /&gt;
Similar to the case of MSD, the diffusion coefficient was also estimated using the running integrals from simulations involving one million atoms.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112647123.png|frame|none|Plot of the running integral of the VACF against time for the three phases using one million atoms for the simulation]] &lt;br /&gt;
&lt;br /&gt;
For the solid and gaseous simulations, the estimate of the diffusion coefficient will be very similar to that of the simulations that used less atoms.&lt;br /&gt;
* For the liquid simulation using one million atoms, the noise has at least been smoothed out and we can make out a clearer convergence of the running integral at about 0.27. This gives a value of &#039;&#039;&#039;0.09 for the diffusion coefficient&#039;&#039;&#039;.&lt;br /&gt;
The largest source of error in calculating &#039;&#039;&#039;D&#039;&#039;&#039; from the VACF is possibly from the use of the trapezium rule, which is one of the simplest forms of numerical integration. A more precise method, such as Simpson&#039;s rule which uses fitting quadratics, could lead to an estimate of the diffusion coefficient with a smaller error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good analysis.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MDhz4813&amp;diff=596453</id>
		<title>Talk:Mod:MDhz4813</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:MDhz4813&amp;diff=596453"/>
		<updated>2017-03-08T06:03:54Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: A lot of questions missing.  You need to explain your results and what they tell you about your simulations.  Make sure you un...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: A lot of questions missing.  You need to explain your results and what they tell you about your simulations.  Make sure you understand the background theory behind each task.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1.Introduction&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Liquids are very important in our life. This is not only because liquid is a state of matters, but also because many technologies processes, biological molecules molecules, membrane and ourselves process or live in liquid medium like water. Thus forces in such systems will determine and explain a lot of phenomenons and properties of everyday things. This is the reason why we need to study liquids at molecular level.&lt;br /&gt;
&lt;br /&gt;
In recent years, a lot of accomplishments of molecular theories in liquids have been achieved. Because get exact solutions for Schrodinger equation of liquids are impossible, molecular approach become a utility way to analysis liquid. In the molecular approach, a molecule usually is modeled in its known properties ( like bond angles, charge distribution, etc.). Then a computer works out how a system composed of such molecules behaviors when the molecule in the system is allowed to interact with its neighboring molecules with interaction potential like the Lennard-Jones potential. Such computer simulation provides a useful insight to properties of liquid at molecular level.&lt;br /&gt;
&lt;br /&gt;
There are two famous techniques of computer simulations. One is the &#039;&#039;Monte Carlo (MC)&#039;&#039; and the other one is &#039;&#039;Molecular Dynamics (MD)&#039;&#039;. In this experiment, we will focus on the MD method. In this method, computer will calculate force on the molecule by solving the Newton equations. This force determined movement of the molecule. Then computer will work out such forces of all molecules we are interested (often said molecules in the box). Trajectories of those molecules also can be achieved as function of time. In equilibrium, the MC and MD methods will get the same final results about position. However, the MD method can provide information about how the molecule moves. Since the MD method also can be used to non-equilibrium and time-dependent system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2.Theory&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2.1  Velocity-Verlet algorithm&lt;br /&gt;
&lt;br /&gt;
By using the velocity-Verlet algorithm, the behavior of a classical harmonic oscillator will be calculated.&lt;br /&gt;
[[File:Position graph.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Position as a function of time as timesept equal 0.1.]][[File:Energy_graph.png|300px|thumb|right|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Energy as a function of time as timesept equal 0.1.]][[File:Error_graph.png|300px|thumb|left|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Error as a function of time as timesept equal 0.1.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Position is a periodical function  (shown in figure 1) with time with 6.4 second as period time and amplitude is positive and negative 1. The energy of this oscillator (shown in figure 2)is also a periodical function with time. The period time is 3.2 seconds and amplitude is 5E-001. Error (shown in figure 3)between analysis value and value got by velocity-Verlet algorithm shows periodical property with time. the period is 3.2 seconds and amplitude increases with time.                                                                                &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: For what value of timestep is the fluctuation in energy about 1 percent?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2.2 Atomic Forces  &lt;br /&gt;
&lt;br /&gt;
When we calculate force between molecules, we assume that Lennard-Jones potential is associated with this force.&lt;br /&gt;
&lt;br /&gt;
For a single pair potential, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; where σ is a constant, ϵ is vacuum permittivity constant and r is distance between two interacted particle. &lt;br /&gt;
&lt;br /&gt;
When the potential is zero, r=σ. Force between those two molecules, F=-dφ/dr. &lt;br /&gt;
When r=σ, F=-24ϵ/σ=-24.&lt;br /&gt;
&lt;br /&gt;
If such pair molecules reaches their equilibrium position, pair potential reach its minimum point.Which means dφ/dr=0. The separation distance at this state, &lt;br /&gt;
&lt;br /&gt;
r&#039;&#039;eq&#039;&#039;=(2σ)^(1/6)=2^(1/6)=1.12&lt;br /&gt;
At this separated distance, pair potential φ(r)=4ϵ(σ^12/4 -σ^6/2 )=-2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.004&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.0009&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.00026&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Maths correct, but show your working.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential is a special case of the Mie potential (in 1903), which is  &amp;lt;math&amp;gt;\phi\left(r\right) = \frac{A}{r^{m}} - \frac{B}{r^n} &amp;lt;/math&amp;gt;. The Mie potential is the first time that a formula included both a repulsive term and an attractive term. The negative term in both equation is an expression of attractive term and positive term is associated with repulsive term. In the Lennard-Jones potential, when the separated distance is too small, the potential is positive, which means the repulsive force is dominant. Before reach the equilibrium distance, potential decreases with increasing distance. this means the attractive interaction contribute increasing effect with increasing distance. After the equilibrium distance, the potential decreases and goes to 0 at infinity. This shows when two molecules are far away to each other, the force between them is too small to ignore it. This conclusion also can be shown quantitively by three integrals we calculated above. Those integrals mean total potential from a typical distance to infinity. When the distance increase, the potential become smaller. If r=3σ, potential can be ignore. Thus when we calculate a total force of a molecule in a liquid, interaction of this molecule with distant molecules can be neglect.&lt;br /&gt;
&lt;br /&gt;
2.3 Periodic Boundary Condition&lt;br /&gt;
&lt;br /&gt;
In our simulations, we need to assume number of molecules before calculation.&lt;br /&gt;
In 1 ml of water in standard condition, there are 6.02*10^23 water molecules and its volume is 18 mL. If there are 10000 water molecules, 2.998E-19 mL.&lt;br /&gt;
&lt;br /&gt;
2.4 Reduced Units&lt;br /&gt;
&lt;br /&gt;
When *r=3.2, &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, r=1.088nm.  &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;, ϵ=1.66E-21. The Lennard-Jones potential φ=0.037&amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;. T=180K&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show your working.  Question on periodic boundary conditions missing.  1 ml of water at standard conditions is not 1 mole so there are not 6x10²3 molecules in it.  You need to work out the value of epsilon in kJmol-1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Equilibration&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3.1 Creating the simulation box&lt;br /&gt;
&lt;br /&gt;
When we simulate a liquid, we generate a random position for each atom. However, in reality, atom cannot be actually random position. Mention for The Lennard-Jones potential, there two part in the equation with different signs. One of those two term associated with attractive potential and the other one terms by repulsive potential. When distance between two atom is small, pair potential between them is positive. Which means the repulsive potential is dominant. This is un-favourite. Thus that pair distance is too small is forbidden in real case.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why can&#039;t atoms be generated at random conditions, what is the problem with high repulsive forces?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Thus, atoms are always going to assume to be lattice point. From our input and output files, they show that the number density is 0.8 and lattice distance is 1.07722. The number of density should be number of lattice divides lattice volume. In this case, it is simple cubic, thus lattice number in one lattice unite is 1. Thus the number of density equal 0.8. For a face-centred  cubic lattice, the lattice number in one lattice unit should equal 4 and the number density is 1.2. Thus the lattice distance is 1.7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is very unclear.  Show your working.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If we create_atoms in Face-centred lattice, there will be 1000 unit lattice. In face-centred lattice, each unit lattice has 4 lattice points. Thus, there will be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
3.2 Setting the properties of atoms&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The meaning of this input script is the mass of atom 1 is 1.0; cutoff Lennard-Jones potential with no Coulomb with pair distance 3.0 and there are only one type of atom, and pair coefficient of this atom to all other atom is 1.0.&lt;br /&gt;
&lt;br /&gt;
In computer simulation, if initial condition of positions and velocities are known, we can use Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the pair coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3.3 Running the simulation&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In our program, we need to write as the first one. Before we run simulation, we need to let LAMMPS know the the variable name. The $ followed by curly brackets tell LAMMPS the name. The variable name is the text inside the curly brackets. In second express, LAMMPS does not what variety is, thus it can run the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is not answering the question, why is it better to use variables?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3.4 Checking equilibrium&lt;br /&gt;
&lt;br /&gt;
[[File:Final0.001.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Figures of energy, temperature and pressure as function of time when timesept equal 0.001.]]&lt;br /&gt;
[[File:Final0.0025.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Figures of energy, temperature and pressure as function of time when timesept equal 0.0025.]]&lt;br /&gt;
[[File:Final0.0075.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;: Figures of energy, temperature and pressure as function of time when timesept equal 0.0075.]]&lt;br /&gt;
[[File:Final0.01.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Figures of energy, temperature and pressure as function of time when timesept equal 0.01.]]&lt;br /&gt;
[[File:Final0.015.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: Figures of energy, temperature and pressure as function of time when timesept equal 0.015.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 4-8 shows graph of energy, temperature and pressure as function of time under different timestep. According figures of energy, energy increases as growing time at those five timesteps. This means this system do not reach equilibrium. If it is under equilibrium, there will be a minimum value in energy. When timesteps increase from 0.001 to 0.15, the value of pressure fluctuate around 1.25 and the more smaller timestep the more noisy. Temperature should show the same tendency as pressure. However, when timestep is 0.015, temperature shows an increasing trend. For this reason, this measurement is the worst among five measurements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plot the energy for each timestep on the same graph to compare the different timesteps.  Which timestep did you choose?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4.Under specific conditions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.Thermostats and Barostats&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;
multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \gamma^2 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;\gamma^2= \frac{3 N k_B T}{\sum_i m_i v_i^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Simplify this further, the final answer should be gamma = squareroot(target temperature/current temperature).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
2. The input script&lt;br /&gt;
&lt;br /&gt;
100 is the Number of every, 1000 is the number of repeat, and 100000 is the Number of frequency arguments specify on what timesteps the input values will be used in order to contribute to the average. &lt;br /&gt;
&lt;br /&gt;
[[File:Pressure1.25.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Figures of density as function of temperature when pressure is 1.25 and timesept equal 0.01.]]&lt;br /&gt;
[[File:Pressure1.25.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: Figures of density as function of temperature when pressure is 1.75 and timesept equal 0.01.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 9 and 10 shows linear relationship between density and temperature at two different pressure. The density decrease when temperature increase. The line in red in both figure stand our stimulate value of density and red is ideal gas density calculated by ideal gas equation. Our stimulate value in both cases are smaller than ideal gas density. When pressure increase from 1.25 to 1.75, the  density increases in theory. However, our stimulated value do not have obviously change. This is maybe because the different between two pressures is too small.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The relationship between density and temperature is not linear (in ideal gas density = 1/T).  Why is the ideal gas density higher than the simulation density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5.Heat capacity&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Script1.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;.]]&lt;br /&gt;
[[File:Script2.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;.]]&lt;br /&gt;
[[File:HC.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Figure of heat capacity as function of temperature under two different density.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 11 and 12 show part of script of heat capacity.&lt;br /&gt;
Figure 13 shows heat capacity as function of temperature. When density increases, heat capacity also increase. In both density, heat capacity shows a minimum value at temperature equal 2.4.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You need to explain the trends that you see in your results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;6.Structural properties and the radial distribution function&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Gf.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Figure of the radial distribution function as function of distance under there different states.]]&lt;br /&gt;
[[File:InterGf.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Figure shows integral of the radial distribution function as function of distance under there different states.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figures 14 shows the relationship between the radical distribution function and distant under three different physical states. Those three functions reach the maximum values around one and function has the largest value at solid state. Around 2, distribution function of vapor reaches a stable value at about 1. Distribution function of solid and liquid fluctuate around 1.&lt;br /&gt;
Figure 15 expresses the integral of radical distribution function under three different physical states. All of this function increase with distance. In solid state, this function grows most fastest, then liquid state and final vapour state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You haven&#039;t answered any of the questions in the task, why do the solid, liquid and gas RDFs look so different, what is the lattice parameter, how many first, second and third nearest neighbour atoms are there?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;7. Dynamical properties and diffusion coefficient&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Msd liquid.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 15&#039;&#039;&#039;: Figure of the mean squared displacement as function of timestep under liquid state.]]&lt;br /&gt;
[[File:Msd solid.PNG|300px|thumb|right|&#039;&#039;&#039;Figure 16&#039;&#039;&#039;: Figure of the mean squared displacement as function of timestep under solid state.]]&lt;br /&gt;
[[File:Msd vapour.PNG|300px|thumb|left|&#039;&#039;&#039;Figure 17&#039;&#039;&#039;: Figure of the mean squared displacement as function of timestep under vapour state.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 15-17 show the mean squared displacement as the function of timestep under three different physical states. The mean squared displacement of liquid and vapour increase with growth of timestep. However, the value at vapour state is much larger than that at liquid state. This function under solid state shows fluctuate when timestep is small and at stable value at rest of timestep and the smallest value among those three states. Conclusion according to those graphs suggests common result from our life. Particles in vapour can move the freest, then particles in liquid. Particles in solid have nearly fixed position-they only can vibration and rotation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You should have calculated a numerical value for the diffusion coefficient.  What about the VACF?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:MOD:ZYH1018&amp;diff=596452</id>
		<title>Talk:MOD:ZYH1018</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:MOD:ZYH1018&amp;diff=596452"/>
		<updated>2017-03-08T05:30:21Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General commentsː All tasks answered and plots look good.  Some of your written explanations are quite unclear though, try to make your writing...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General commentsː All tasks answered and plots look good.  Some of your written explanations are quite unclear though, try to make your writing more focused and concise.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running your first simulation==&lt;br /&gt;
This part introduces us the procedures to run simulations with a software package called [http://lammps.sandia.gov LAMMPS]  on the [http://www3.imperial.ac.uk/ict/services/hpc High Performance Computing] (HPC) systems and five example simulations with different timesteps were performed for following sections.&lt;br /&gt;
&lt;br /&gt;
==Introduction to molecular dynamics simulation==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
The Classical Particle Approximation states that in a collection of &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each one of them behaves as aclassical particle and will interact with others and experience a force which causes accelaration according to Newton&#039;s second law. Thus,the atomic positions and velocities at any time can be determined if the force,&amp;lt;math&amp;gt;F_i&amp;lt;/math&amp;gt; is calculated as a fuction of time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. By applying those theories as well as Taylor expension to &amp;quot;classical Verlet Algorithm&amp;quot;, if we denote the position of an atom,&amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt;, at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;, the positions of the atoms at next time step, &amp;lt;math&amp;gt;t + \delta t&amp;lt;/math&amp;gt; can be calculated by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2 \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
However, we cannot acquire any information about the velocities which is needed for calculating the kinetic energy by classical Verlet Algorithm. Therefore, a modified one called &amp;quot;velocity-Verlet Algorithm&amp;quot; is used instead and expressed as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) = \mathbf{x}_i\left(t\right) + \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right)\delta t \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
     &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ For the default time step 0.1 &lt;br /&gt;
|-&lt;br /&gt;
| [[File:Analytical x.PNG ZYH|700px|center|thumb|&amp;lt;b&amp;gt;Figure 1&amp;lt;/b&amp;gt;:　&amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet functions of the position x versus time t.]] || [[File:Error ZYH.png|700px|center|thumb|&amp;lt;b&amp;gt;Figure 2&amp;lt;/b&amp;gt;: Functions of error between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solutions and the maxima in error versus time.]] &lt;br /&gt;
|}&lt;br /&gt;
From figure 1 and figure 2 we can find that the error between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solutions is quite small and the function of the error versus time is kind of &amp;quot;periodic&amp;quot; with increasing amplitudes and a half period compared to that of the position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; of a classical harmonic oscillator, which is given by &amp;lt;math&amp;gt; x\left(t\right) = cos\left(t\right)&amp;lt;/math&amp;gt;, as the error comes to zero when the &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; reaches a minimum or maximum. And the maximum value of error in each period increases linearly with time as a function of &amp;lt;math&amp;gt;y = 0.0004x - 8\times 10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error fluctuate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Error 0.01.PNG|500px|center|thumb|&amp;lt;b&amp;gt;Figure 3&amp;lt;/b&amp;gt;: Energy versus times at 0.01 timestep.]] ||[[File:Error 0.02.PNG|500px|center|thumb|&amp;lt;b&amp;gt;Figure 4&amp;lt;/b&amp;gt;: Energy versus times at 0.02 timestep.]] ||[[File:Error 0.024.PNG|500px|center|thumb|&amp;lt;b&amp;gt;Figure 5&amp;lt;/b&amp;gt;: Energy versus times at 0.024 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:Error vs timestep.PNG|center|700px|thumb|&amp;lt;b&amp;gt;Figure 6&amp;lt;/b&amp;gt;: Maximum percentage change in energy versus timestep.]]&lt;br /&gt;
The energy contains the total energy of the oscillator for the velocity-Verlet solution, which is composed of kinetic energy and potential energy. Therefore,&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{total} = E_K + E_P = \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;k = m = 1&amp;lt;/math&amp;gt; in this case, so:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{total} = \frac{{x_{(t)}}^2 + {v_{(t)}}^2}{2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From figure 3 to figure 6 above, it can be seen that the maximum percentage change in total energy (fluctuation) increases as timestep increases. When timestep is around 0.20, the maximum change in energy is 1%. Thus, the timestep should be no more than 0.20 to ensure that the total energy does not change by more than 1%. Besides, it is important to monitor the total energy of a physical system that does not change or fluctuate too much so that the total of potential and kinetic energy is always conserved if there is no extra force applied on the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, thorough analysis..&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
For a single Lennard-Jones interaction, the potential energy is zero when:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_0\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6}\right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearrange to get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force acting on the atom is determined by the potential it expierences:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( 12(\frac{\sigma^{12}}{r^{13}}) - 6(\frac{\sigma^6}{r^7})\right) = 24\epsilon \left( 2(\frac{\sigma^{12}}{r^{13}}) - \frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;r = r_0 = \sigma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F_{(r_0)}} = 24\epsilon \left(\frac{2}{\sigma} - \frac{1}{\sigma}\right) = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium will be reached when the resultant force &amp;lt;math&amp;gt;F&amp;lt;/math&amp;gt; equals zero (the potential energy &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; reaches a minimum):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F_(r_{eq)}} = 24\epsilon \left( 2(\frac{\sigma^{12}}{{r_{eq}}^{13}}) - \frac{\sigma^6}{{r_{eq}}^7}\right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rearrange to get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^{6}}{{r_{eq}}^{6}} = \frac{1}{2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the well depth is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left({r_{eq}}\right) = 4\epsilon \left( \frac{\sigma^{12}}{{r_{eq}}^{12}} - \frac{\sigma^6}{{r_{eq}}^6}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^{6}}\right) = -\epsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int\phi\left(r\right)\mathrm{d}r = \int\left( \frac{4}{r^{12}} - \frac{4}{r^{6}}\right)\mathrm{d}r = - \frac{4}{11{r^{11}}} + \frac{4}{5{r^{5}}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2\sigma}^\infty\phi\left(r\right)\mathrm{d}r = 0 + \frac{4}{11}\times 2^{-11} - \frac{4}{5}\times 2^{-5} \approx -2.48 \times 10^{-2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty\phi\left(r\right)\mathrm{d}r = 0 + \frac{4}{11}\times 2.5^{-11} - \frac{4}{5}\times 2.5^{-5} \approx -8.18 \times 10^{-3}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int_{3\sigma}^\infty\phi\left(r\right)\mathrm{d}r = 0 + \frac{4}{11}\times 3^{-11} - \frac{4}{5}\times 3^{-5} \approx -3.29 \times 10^{-3}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
Under standard conditons, the density of water &amp;lt;math&amp;gt;\rho = 1.0 gmL^{-1}&amp;lt;/math&amp;gt;, and the total mass of water molecules in &amp;lt;math&amp;gt;1 mL&amp;lt;/math&amp;gt; of water &amp;lt;math&amp;gt;m = 1.0 g&amp;lt;/math&amp;gt;. Therefore, &lt;br /&gt;
the number of moles of water molecules is &amp;lt;math&amp;gt;n_{H_{2}O}= \frac {m_{H_{2}O}}{M_{H_{2}O}} = \frac {1.0g}{18 gmol^{-1}}\approx 0.056 mol&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of water molecules in &amp;lt;math&amp;gt;1mL&amp;lt;/math&amp;gt; of water is &amp;lt;math&amp;gt; N_{H_{2}O} = n_{H_{2}O}\times N_{A} = 0.056 mol\times 6.023\times 10^{23}mol^{-1} \approx 3.35 \times 10^{22}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules is &amp;lt;math&amp;gt;V = \frac{10000}{3.35 \times 10^{22} mL^{-1}} \approx 3.0 \times 10^{-19}mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The atom at initial position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt; and will reach at the final position &amp;lt;math&amp;gt;(0.5 + 0.7, 0.5 + 0.6, 0.5 + 0.2)&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;1.2, 1.1, 0.7&amp;lt;/math&amp;gt; under classical conditions. But by applying the periodic boundary conditions, the atom moves in a cubic simulation box which runs from &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt;, and when it crosses the boundary of the box,one of its replicas enters the box through the opposite site. Therefore, the final position that the atom ends up should be &amp;lt;math&amp;gt;(1.2 - 1, 1.1 - 1, 0.7) = (0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
When the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, The distance in real units should be:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r = \sigma{r^*} = 0.34 nm\times 3.2 = 1.088 nm \approx 1.1 nm&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}\right)N_A = 4\epsilon \left( \frac{\sigma^{12}}{(\sigma{{r^*})}^{12}} - \frac{\sigma^6}{{(\sigma{r^*})}^{6}}\right)N_A = 4\epsilon \left( \frac{1}{{r^*}^{12}} - \frac{1}{{r^*}^6}\right)N_A = 4\times 120K \times K_B\left( \frac{1}{{r^*}^{12}} - \frac{1}{{r^*}^6}\right)N_A&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;= &amp;lt;math&amp;gt;4\times 120K \times 1.381\times 10^{-23}JK^{-1}\times\left( \frac{1}{{3.2}^{12}} - \frac{1}{{3.2}^6}\right)\times 6.02\times 10^{23}mol^{-1} \approx -3.71Jmol^{-1} = -3.71\times 10^{-3}kJmol^{-1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reduced teperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units is :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T = \frac{\epsilon}{K_B}T^* = 120K \times 1.5 = 180K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct, except for the well depth.  You have already shown that the well depth is just epsilon, so you just need to convert the value of epsilon given into kJmol-1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
As it mentioned before, we need to specify the starting position of each atom before staring a simulation. However, it is quite hard to determine a point of reference for atoms in a liquid because there is no ordered crystal structures or unit cells. We could generate a random starting position for each atom, but this would probably cause a situation that two atoms are too close or overlapped together. And according to the Lennard-Jones potential relationship:    &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}\right) = 0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the distance between two atoms are small, the potential energy will be infinitely large, which could cause a large error in simulation.&lt;br /&gt;
&lt;br /&gt;
Consider a simple cubic lattice which consists of one lattice point on each corner of the cube, each atom at a lattice point is shared equally between eight adjacent cubes. So there is totally &amp;lt;math&amp;gt;\frac{1}{8}\times8 = 1&amp;lt;/math&amp;gt; atom in each unit cell. When the number density is &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;number density&amp;lt;math&amp;gt;n=\frac{\frac{1}{8}\times8}{1.07722^3} \approx 0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
Consider a face-centered cube which consists of one lattice point on each corner and face of the cube, each atom on the face is shared equally between rwo adjacent cubes. It gives totally &amp;lt;math&amp;gt;\frac{1}{8}\times8 + \frac{1}{2}\times6= 4&amp;lt;/math&amp;gt; atoms in each unit cell. If the number density is 1.2, &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;1.2 =\frac{4}{r^3}&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;r = \sqrt[3]{\frac{4}{1.2}} \approx 1.4938&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the face-centered cubic lattice, each unit cell contains 4 lattice points or atoms as calculated before. Therefore, in a box that contains &amp;lt;math&amp;gt;1000&amp;lt;/math&amp;gt; unit cells of this lattice, there are &amp;lt;math&amp;gt;4\times1000 = 4000&amp;lt;/math&amp;gt; atoms in total.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
this defines the mass of the single atom of type 1 is 1.0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The lj/cut styles computes the standard 12/6 Lennard-Jones potential, given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E = 4\epsilon[(\frac{\sigma}{r})^{12}-(\frac{\sigma}{r})^{6}],          r&amp;lt; r_c&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;http://lammps.sandia.gov/doc/pair_lj.html&amp;lt;/ref&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;R_c&amp;lt;/math&amp;gt; is the cuttoff, it equals to 3.0 in this case, which means the LJ interaction over separating distance 3.0 is negligible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It specifies the pairwise force field coefficients for one or more pairs of atom types, &amp;lt;math&amp;gt;\epsilon = \sigma = 1&amp;lt;/math&amp;gt; in this case. An asterisk means all types of atoms from 1 to N, and then the two asterisks indicate that the coefficients apply to LJ potential between any two atoms.&amp;lt;ref&amp;gt;http://lammps.sandia.gov/doc/pair_coeff.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If initial conditions with &amp;lt;math&amp;gt;x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are specified, then we will apply velocity-Verlet Algorithm to run the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, why is a cutoff used for the potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we define a variable called &amp;quot;timestep&amp;quot; and thus we can just type ${timestep} in the following parts instead of the exact number. The advantage of this is that when we need to change the timestep, we only need to change the timestep number in the second line and the ${timestep} in the following parts will be changed automatically. However, if we just write:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Once we need to change timestep, we need to change every timestep in the whole text manually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Energy versus time.PNG|600 px|thumb|&amp;lt;b&amp;gt;Figure 7&amp;lt;/b&amp;gt;: Total energy versus time at a timestep 0.001]] || [[File:Temp versus time.PNG|600 px|thumb|&amp;lt;b&amp;gt;Figure 8&amp;lt;/b&amp;gt;: Temperature versus time at a timestep 0.001]] || [[File:Pressure versus time.PNG|600 px|thumb|&amp;lt;b&amp;gt;Figure 9&amp;lt;/b&amp;gt;:Pressure versus time at a timestep 0.001]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From figure 7 to figure 9 above, it can be seen that the energy, temperature and pressure reaches constant with small fluctuations after a short time, which indicates that the simulation reaches equilibrium. The fluctuations(error) in energy is the smallest compared to those in temperature and pressure. From the thermodynamic data of the simulation, it takes about 0.22 and 0.18 to reach the equilibrium for temperature and pressure respectively. And it takes around 0.28 for energy to reach the equilibrium just after the equilibrium of temperature and pressure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:E vs time various.PNG|700 px|thumb|center|&amp;lt;b&amp;gt;Figure 10&amp;lt;/b&amp;gt;: Energy versus time for five different timesteps]]&lt;br /&gt;
From figure 10 we can notice that the simulations of energy at timesteps at 0.001 and 0.0025 after the equilibrium is reached are almost overlapped, and the simulations of energy at 0.0075 and 0.01 reaches equilibrium as well but with relatively higher energies compared to those at timesteps 0.001 and 0.0025, which cause larger errors or fluctuations.Therefore, the largest timestep that gives acceptable results is 0.0025. The one with the largest timestep 0.015 is a particularly bad choice because the energy increases as time increases with relative large fluctuation(error) and never reaches equilibrium. Therefore, the total energy will not be conserved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy should not depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
Ten npt input files with different combinations of five tempreatures(1.6, 1.8, 2.0, 2.5, 3.0) and two pressures(2.6, 2.7) in reduced units are modified to run simulations on the HPC portal.&lt;br /&gt;
&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
In the system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms, each with three degrees of freedom, according to the equipartition theorem, we can obtained that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After each velocity is multiplied by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;, the temperature &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; is corrected to &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i ({v_i\gamma})^2 = \frac{\gamma^2}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B {\mathfrak{T}} (5)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide &amp;lt;math&amp;gt;(5)&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;(4)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\frac{\gamma^2}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B {\mathfrak{T}}}{\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
The number &amp;quot;100&amp;quot; corresponds to &amp;lt;math&amp;gt;N_{every}&amp;lt;/math&amp;gt;, which means using input values every 100 timesteps. The number &amp;quot;1000&amp;quot; corresponds to &amp;lt;math&amp;gt;N_{repeat}&amp;lt;/math&amp;gt;, which means number of times to use input values for calculating averages. And the number &amp;quot;100000&amp;quot; corresponds to &amp;lt;math&amp;gt;N_{freq}&amp;lt;/math&amp;gt;, which means calculating averages every this timestep. The &amp;lt;math&amp;gt;N_{every}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N_{repeat}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N_{freq}&amp;lt;/math&amp;gt; arguments specify on what timesteps the input values will be used in order to contribute to the average. The final averaged quantities are generated on timesteps that are a multiple of &amp;lt;math&amp;gt;N_{freq}&amp;lt;/math&amp;gt;. The average is over &amp;lt;math&amp;gt;N_{repeat}&amp;lt;/math&amp;gt; quantities, computed in the preceding portion of the simulation every &amp;lt;math&amp;gt;N_{every}&amp;lt;/math&amp;gt; timesteps.&amp;lt;ref&amp;gt;http://lammps.sandia.gov/doc/fix_ave_time.html&amp;lt;/ref&amp;gt; Therefore, in this case values on timesteps &amp;lt;math&amp;gt;100&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;200&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;300&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;400&amp;lt;/math&amp;gt;, ..., &amp;lt;math&amp;gt;100000&amp;lt;/math&amp;gt; will be used to compute the final average on timestep &amp;lt;math&amp;gt;100000&amp;lt;/math&amp;gt;, which means every &amp;lt;math&amp;gt;100&amp;lt;/math&amp;gt; timesteps, values of the temperature, etc., be sampled for the average. And totally &amp;lt;math&amp;gt;\frac{100000}{100} = 1000&amp;lt;/math&amp;gt; measurements(the same as &amp;lt;math&amp;gt;N_{repeat}&amp;lt;/math&amp;gt;) will contribute to the average. Because we need to run the simulation until reaching the final timestep &amp;lt;math&amp;gt;100000&amp;lt;/math&amp;gt;, if we assume the timestep is &amp;lt;math&amp;gt;0.0025&amp;lt;/math&amp;gt;, and then the total time we need to simulate is &amp;lt;math&amp;gt;100000\times 0.0025 = 250&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:2.62.6.PNG|center|700px|thumb|&amp;lt;b&amp;gt;Figure 11&amp;lt;/b&amp;gt;:Density versus temperature at pressure 2.6]] || [[File:2.72.7.PNG |700px|center|thumb|&amp;lt;b&amp;gt;Figure 12&amp;lt;/b&amp;gt;: Density versus temperature at pressure 2.6]] &lt;br /&gt;
|}&lt;br /&gt;
According to the ideal gas law and reduced units conversion:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;PV = NK_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;P=P^*\frac{\epsilon}{\sigma ^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\frac{\epsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density in reduced units can be obtained by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=\sigma ^3\frac{N}{V} = \sigma ^3\frac{P}{K_BT} = \sigma ^3\frac{\frac{\epsilon}{\sigma ^3}P^*}{K_B\frac{\epsilon}{K_B}T^*} = \frac{P^*}{T^*}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use this derivation of the density in reduced units to plot graphs of density versus temperature. And it is shown from figure 11 and 12 that the simulated densities in both cases are lower that calculated by ideal gas law. This is because the ideal gas law assumes that there is no interactions between particles. But in this simulation case, there are LJ interactions between atoms, which means there could be a repulsion between atoms that repel them further apart. And the density is the number of atoms per unit volume, therefore, the simulation density is always lower than the ideal density because of the longer distances between atoms due to LJ interactions(repulsion). And as temperature increases, the density decreases. This is because the volume of the system will increase as temperature increases when pressure is constant according to the ideal gas law. Therefore, the density decreases with temperature as the total number of atoms remains the same but the volume increases.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
[[File: Discrepancy111.PNG|700px|center|thumb|&amp;lt;b&amp;gt;Figure 13&amp;lt;/b&amp;gt;:Discrepancy versus temperature at pressure 2.6 and 2.7]]&lt;br /&gt;
|}&lt;br /&gt;
As shown in figure 13, the density at pressure 2.7 is always higher than the density at pressure 2.6, we can consider at a given temperature and number of atoms, when pressure increases, volume will decrease according to ideal gas law, which indicates that atoms pretend to be closer and suffer greater repulsion forces due to LJ interaction, thus it will deviate more from the ideal one. Besides, the trend of the discrepancy decreases as temperature increases, this is because as temperature increases, volume increases as well if the pressure and number of atoms are constant. Therefore, atoms becomes further apart from each other and affected less from the LJ interaction, and the increased volume caused by it is less and less significant compared to the total volume, which increases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JCː Explanations are correct, but a bit unclear, try to make them more concise.  Joining the ideal gas data points with straight lines is misleading because the ideal gas law does not follow these lines in between data points.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
below is the input script with &amp;lt;math&amp;gt;\rho = 0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T = 2.0&amp;lt;/math&amp;gt; to run the simulation for heat capacity &amp;lt;math&amp;gt;C_V&amp;lt;/math&amp;gt; under &amp;lt;math&amp;gt;NVT&amp;lt;/math&amp;gt; conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 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;
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;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp vol atoms density&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp2 v_E v_E2 v_N2 v_temp&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[6]&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[4]-f_aves[3]*f_aves[3])/f_aves[2]&lt;br /&gt;
variable CperV equal ${heatcapacity}/${volume}&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;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity/volume: ${CperV}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The heat capacity can be calculated by the equation:&lt;br /&gt;
&amp;lt;center&amp;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} (6)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the volume is constant under &amp;lt;math&amp;gt;NVT&amp;lt;/math&amp;gt; conditions, and we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature &amp;lt;math&amp;gt;\left(P^*, T^*\right)&amp;lt;/math&amp;gt;phase space. Therefore, density &amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt; is defined as a variable rather than pressure &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
[[File:ZYH HEAT CAPACITY.PNG|700px|center|thumb|&amp;lt;b&amp;gt;Figure 14&amp;lt;/b&amp;gt;:Heat capacity per volume versus temperature at two densities 0.2 and 0.8 respectively]]&lt;br /&gt;
|}&lt;br /&gt;
It can be seen that the heat capacity per volume decreases as temperature increases for both densities, which is consistent with the equation &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt;. This is because as temperature increases, more atoms absorbs enough energy to reach the excited states or higher energy levels in a constant volume, which means fewer atoms on the ground state can absorb extra energy from outside. Therefore, fewer energy can be taken by the atoms in the system with constant volume and the heat capacity per volume decreases as well as temperature increases. Besides, the heat capacity per volume at density 0.8 is always higher than that at density 0.2. According to the equation: &amp;lt;math&amp;gt;\rho^* = \frac{P^*}{T^*} &amp;lt;/math&amp;gt;, the pressure will be greater for a larger density if the temperature is constant. And the larger pressure and density means that atoms are closer and larger amount of atoms in a constant volume. Therefore, we can choose a constant temperature at x-axis in figure 14 and find its corresponding y values of heat capacity per volume at both densities, the one with a higher density 0.8 has a larger value because there are more atoms per unit volume that can absorb energy and be excited to higher levels, which leads to a higher heat capacity. And according to the equation &amp;lt;math&amp;gt;(6)&amp;lt;/math&amp;gt;, the variance in energy &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; increases as density increases, so the heat capacity increases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct explanation of the trend in heat capacity with density, the trend with temperature is harder to explain and would need more analysis beyond the scope of this experiment.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
[[File:RDF 3 phases.PNG|700 px|thumb|center|&amp;lt;b&amp;gt;Figure 15&amp;lt;/b&amp;gt;: RDF g(r) versus distance r for solid, liquid and vapour phases]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Phase !! Density (reduced unit) !! Temperature (reduced unit) !! Characters and differences in RDF &lt;br /&gt;
|-&lt;br /&gt;
| Vapour || 0.05 || 2.2 || There is only one peak in RDF, which means atoms in vapour state are disordered and moving randomly. So there is no extra peaks which shows long or short rang order.&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || 0.8 || 1.2|| There are three main peaks with decreasing amplitudes, and the decay rate is faster compared with that of solid. This is because the atoms in liquid phase has a short range order and has a higher degree of freedom, which means the velocity or VACF is influenced more by the distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Solid || 1.2 || 0.5 || In solid states, atoms are highly ordered and packed closely due to the large density, and this leads to relatively high values of RDF. There are many peaks with shorter widths and decreasing amplitudes, and the decay rate is slower than that of liquid state. This is because the atoms in solid state only vibrate and have lowest degree of freedom. Therefore, the RDF is affected the least by the increasing distance. And the first three peaks correspond to short range order, the following small peaks correspond to long range order. The widths between the peaks is corresponding to the distances between atoms in the first coordination shell, second coordination shell and etc. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, but what do you mean by &amp;quot;...the velocity or VACF is influenced more by the distance r.&amp;quot;?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The graph of integral of &amp;lt;math&amp;gt;G(r)&amp;lt;/math&amp;gt; in the solid state versus distance is shown as below:&lt;br /&gt;
[[File:Integral of Gr for solid.PNG|700 px|thumb|center|&amp;lt;b&amp;gt;Figure 16&amp;lt;/b&amp;gt;: integral of RDF g(r) versus distance r for solid phase]]&lt;br /&gt;
&lt;br /&gt;
And according to the FCC structure&amp;lt;ref&amp;gt;http://www.physics-in-a-nutshell.com/article/11&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc.PNG|700 px|thumb|center|]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to the 12 atoms (colored in blue orange and green) located at the center of the &amp;lt;math&amp;gt;12&amp;lt;/math&amp;gt; faces of unit cells, which adjacent to the central reference atom(red one). The second peak corresponds to &amp;lt;math&amp;gt;18 - 12 = 6&amp;lt;/math&amp;gt; atoms (pink), which are secondly nearest to the central reference atom and located at the corners that are the most close to the reference atom. The third peak corresponds to &amp;lt;math&amp;gt;42 - 18 = 24&amp;lt;/math&amp;gt; atoms, which are located at the rest of all grey points at the center of each face of unit cell. Because these points are closer to the reference atom than those at the corner. And the lattice spacing is just the same as the distance between any one of pink atoms and the central red atom according to the FCC lattice above, therefore, the lattice spacing is equal to the distance of the second peak which &amp;lt;math&amp;gt;1.625&amp;lt;/math&amp;gt; as shown in the figure 16.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good diagram to show which atoms are responsible for the first 3 peaks.  Could you have calculated the lattice parameter from the first and third peaks as well and then averaged it, how does it compare to the lattice parameter of the initial structure of your simulation?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
From simulations of my relatively small system, we can get the relationships between MSD and timestep for different phases:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:MSD G.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 17&amp;lt;/b&amp;gt;:Total MSD versus time for vapour phase]] || [[File:MSD L.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 18&amp;lt;/b&amp;gt;: Total MSD versus time for liquid phase]] || [[File:MSD S.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 19&amp;lt;/b&amp;gt;: Total MSD versus time for solid phase]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Acoording to the equation :&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated if the gradient (first derivative) of the line part in each diagram of MSD versus timestep is known, as the linear relationship needs a little time to be established. And the gradient can be calculated by any two points on the linear part.Therefore:&lt;br /&gt;
&lt;br /&gt;
In vapour phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times\frac{252 - 102}{9.752 - 5.196} \approx 5.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times\frac{4.76 - 1.21}{4702 - 1243} \approx 0.086&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times0 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the data calculated above, it can be seen that the diffusion rate decreases from vapour phase to solid phase as expected. Atoms in the solid state are almost fixed in the lattice points with relative large density, which means the atom will experience much repulsion forces if it diffuses through the structure. Therefore, For atoms in the solid state, they can hardly diffuse due to the large energy barrier and the diffusion rate is almost zero. Besides, the diffusion rate of atoms in the vapour state is larger than that in the liquid state. Because the density for gas is much smaller, which means the interactions between atoms is quite small, and atoms can move as random motion, which are less restricted by others. Therefore, the atoms in the vapour state have the largest diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
From the one million atom simulations, we can we can get the relationships between MSD and timestep for different phases: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:MSD G 1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 20&amp;lt;/b&amp;gt;:Total MSD versus time for vapour phase]] || [[File:MSD L 1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 21&amp;lt;/b&amp;gt;: Total MSD versus time for liquid phase]] || [[File:MSD S 1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 22&amp;lt;/b&amp;gt;: Total MSD versus time for solid phase]]|&lt;br /&gt;
|}&lt;br /&gt;
Diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by similar methods above:&lt;br /&gt;
&lt;br /&gt;
In vapour phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times\frac{140 - 82.2}{9.776 - 6.738}\approx 3.17&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times\frac{5.8 - 1.25}{9.776 - 2.538}\approx 0.105&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid phase, &amp;lt;math&amp;gt;D = \frac{1}{6}\times0 = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients for the larger system have similar magnitudes and trends as before, the graph of MSD in solid state seems more accurate with fewer error than that of the smaller system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It is more accurate to fit the linear part of the graph to a straight line to calculate the gradient, rather than calculating the gradient from only 2 data points.  Why does the vapour MSD take longer to become linear - initial motion is ballistic.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
The position of a classical harmonic oscillator is given by:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be obtained by the first derivative of the position function:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt} =\frac{d({A\cos\left(\omega t + \phi\right)})}{dt} = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, simply by substitution we can get:&lt;br /&gt;
&amp;lt;center&amp;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} = \frac{\int_{-\infty}^{\infty} [-A\omega \sin(\omega t+ \phi)] \times [-A\omega \sin(\omega(t + \tau) +\phi)]\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega \sin(\omega t+\phi))^2\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} \sin(\omega t+\phi) \sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t} = \frac{\int_{-\infty}^{\infty} \sin(\omega t+\phi) \sin(\omega t +\phi +\omega\tau) )\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The function can be further split by applying &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}\sin(\omega t+\phi)[\sin(\omega t+ \phi)\cos(\omega \tau)+\cos(\omega t+\phi)\sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin(\omega \tau)&amp;lt;/math&amp;gt; are constant, they can be taken out directly:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau)\frac{\int_{-\infty}^{\infty}\sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}+\sin(\omega \tau)\frac{\int_{-\infty}^{\infty}\sin(\omega t+ \phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;= \cos(\omega \tau) + \sin(\omega \tau)\frac{\int_{-\infty}^{\infty}\sin(\omega t+ \phi)\cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;\sin(x)\cos(x) = \frac{\sin(2x)}{2}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \sin(\omega \tau)\frac{\frac{1}{2}\int_{-\infty}^{\infty}\sin(2(\omega t+ \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function, the integration from negative infinity to positive infinity should be zero. Therefore:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau) + \sin(\omega \tau)\frac{\frac{1}{2}\times 0}{\int_{-\infty}^{\infty} \sin^2(\omega t+\phi)\mathrm{d}t} = \cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, sin(x)cos(x) is also an odd function (even x odd = odd), so you don&#039;t really need to do the last step.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Last part.PNG|700 px|thumb|center|&amp;lt;b&amp;gt;Figure 22&amp;lt;/b&amp;gt;: VACF &amp;lt;math&amp;gt;C(\tau)&amp;lt;/math&amp;gt; for solid phase, liquid phase and 1D harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
According to the velocity autocorrelation function:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
It can be seen that &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; is the dot product of the velocities at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt;. And the minima correspond to the particle collides with another with an angle (&amp;lt;math&amp;gt;\approx 180&amp;lt;/math&amp;gt;) which maximize the dot product and changes its direction after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;. The initial value of VACF at &amp;lt;math&amp;gt;t = 0&amp;lt;/math&amp;gt; for liquid is greater than that for solid. This is because the atoms in liquid state can move more freely with larger initial velocity, but atoms in solid state can only vibrate around fixed position with much lower velocity.&lt;br /&gt;
&lt;br /&gt;
The simple harmonic oscillator behaves differently because there is no collision and the total momentum and energy are conserved all the time. But for the Lennard Jones solid and liquid, the velocity will keep decreasing as time increases because of the loss of kinetic energy or momentum during the collision.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Kinetic energy is not lost in the Lennard-Jones simulations, but collisions randomise particle velocities which causes the decay in the VACF.&amp;lt;/span&amp;gt;&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
The integral under the velocity autocorrelation function can be estimated by applying the trapezium rule, the relationships between the integral and time for my small gas, liquid and solid simulation can be obtained:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:Gas1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 23&amp;lt;/b&amp;gt;:Running integral of VACF versus time for vapour phase]] || [[File:Liquid1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 24&amp;lt;/b&amp;gt;: Running integral of VACF versus time for liquid phase]] || [[File:Solid1.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 25&amp;lt;/b&amp;gt;: Running integral of VACF versus time for solid phase]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Accoording to the velocity autocorrelation function:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulations are all started from initial time &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(0\right) \cdot \mathbf{v}\left(0+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And accoording to the diffusion coefficient equation:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals of VACF from time &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;10&amp;lt;/math&amp;gt; have been calculated from figures above, because VACF converges to &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; as time increases, therefore:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D \approx \frac{1}{3}\int_0^{10} C\left(\tau\right)\mathrm{d}\tau &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In vapour phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 17.24647 \approx 5.75&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 0.293667 \approx 0.098&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 0.000183 \approx 6.1\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the one million atom simulations:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| [[File:Gas2.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 26&amp;lt;/b&amp;gt;:Running integral of VACF versus time for vapour phase]] || [[File:Liquid2.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 27&amp;lt;/b&amp;gt;: Running integral of VACF versus time for liquid phase]] || [[File:Solid2.PNG|500px|thumb|&amp;lt;b&amp;gt;Figure 28&amp;lt;/b&amp;gt;: Running integral of VACF versus time for solid phase]]|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In vapour phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 9.805397 \approx 3.27&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 0.270274 \approx 0.09&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In solid phase, &amp;lt;math&amp;gt;D \approx \frac{1}{3} \times 0.000137 \approx 4.57\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Th diffusion coefficients for three phases from the two simulations are calculated as expected, because they decrease from vapour phase to solid phase.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; should be calculated by integration of VACF from zero to infinity, however in this case we only calculate from zero to ten. Besides, we use the trapezium rule to estimate the integral with a &amp;lt;math&amp;gt;\delta t = 0.002&amp;lt;/math&amp;gt;, it is not infinitely small and so the estimated area under the function by many small trapezoids is not perfectly matched with the actual area, which means the integral may be underestimated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, the running integral needs to plateau for this estimate of D to be accurate.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Liquid_simulations&amp;diff=596451</id>
		<title>Talk:Mod:Liquid simulations</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Liquid_simulations&amp;diff=596451"/>
		<updated>2017-03-08T03:21:01Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General commentsː Some good answers, but also some graphs and parts of questions are missing.  Make sure you answer the questions in full before adding extra results and focus on making sure that your written explanations are clear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Introduction to molecular dynamics simulation=&lt;br /&gt;
&lt;br /&gt;
==Verlet algorithm for the 1D harmonic oscillator==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Oscmaximabs.PNG|thumb|500px]|Figure1: Error maxima as a function of time ]]&lt;br /&gt;
|[[File: Oscenergybs.PNG|thumb|500px]|Figure2: Total energy as a function of time ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Fig. 1 shows the energy error maxima in time for a timestep of 0.1. As one can see from the figure itself, all the maxima lie on a straight line. The particular line &amp;lt;math&amp;gt;y=4*10^{-7} x-7*10^{-5}&amp;lt;/math&amp;gt; gives a perfect fit.&lt;br /&gt;
From a practical point of view, however, a timestep this small is not necessary. It is important to note that the total energy of a harmonic oscillator is constant in time, so a fluctuation of 1% is good enough for practical purposes. If the error is too large or, even worse, it does not converge, the simulation becomes unrealistic (useless). Different timesteps have been tried and 0.2 is the largest acceptable timestep. This is because it gives a 1% maximum error in total energy, as fig. 2 shows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The fit isn&#039;t perfect if you look to more than 1 s.f.  Good choice of timestep, how many others did you try?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Lennard-Jones potential==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r)=4\epsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_0)=0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^6}{r_0^6}=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^{12}}{r_0^{12}}=\frac{\sigma^6}{r_0^6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^6}{r_0^6}=1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma}{r_0}=1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_0=\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This potential energy creates a conservative force field. Therefore, the force at any distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; can be linked to the potential energy at the same distance by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=-\frac{d\phi}{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=4\epsilon(-12\frac{\sigma^{12}}{r^{13}}+6\frac{\sigma^6}{r^7})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=24\epsilon(\frac{\sigma^6}{r^7}-2\frac{\sigma^{12}}{r^{13}})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; this force is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(\sigma)=24\epsilon(\frac{\sigma^6}{\sigma^7}-2\frac{\sigma^{12}}{\sigma^{13}})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(\sigma)=-24\frac{\epsilon}{\sigma}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the position where the force is zero.&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_{eq})=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the equation linking force to potential energy we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
24\epsilon(\frac{\sigma^6}{r_{eq}^7}-2\frac{\sigma^{12}}{r_{eq}^{13}})=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^6}{r_{eq}^7}=2\frac{\sigma^{12}}{r_{eq}^{13}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
1=2\frac{\sigma^6}{r_{eq}^6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}^6=2\sigma^6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=\sigma 2^{\frac{1}{6}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by the value of the potential at the equilibrium position, &amp;lt;math&amp;gt;\phi(r_{eq})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^6}{r_{eq}^6})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=4\epsilon(\frac{1}{4}-\frac{1}{2})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=-\epsilon&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating some relevant integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{2\sigma}^{\infty} \phi(r) dr=4\epsilon \int _{2\sigma}^{\infty} (\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^6})=\Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{2\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*2^{11}}-\frac{1}{5*2^5})=-0.0248\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{2.5\sigma}^{\infty} \phi(r) dr = \Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{2.5\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*2.5^{11}}-\frac{1}{5*2.&lt;br /&gt;
5^5})=-0.008\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{3\sigma}^{\infty} \phi(r) dr = \Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{3\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*3^{11}}-\frac{1}{5*3^5})=-0.0032\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;\epsilon=\sigma=1.0&amp;lt;/math&amp;gt; the integrals become -0.0248, -0.008 and -0.0032 respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Water volume==&lt;br /&gt;
&lt;br /&gt;
Under standard conditions the density of water is &amp;lt;math&amp;gt;\rho=1 \frac{g}{ml}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The volume of N=10000 molecules can be estimated as follows:&lt;br /&gt;
The number of moles is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{N}{N_A}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass is&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=n\mu_{water}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=\frac{N\mu_{water}}{N_A}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, the volume can be written as&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{m}{\rho}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{N\mu_{water}}{N_A\rho}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{10000*18}{6.022*10^{23}*1}=3*10^{-19} ml&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how many water molecules are there in 1 ml of water?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Moving a particle along a vector==&lt;br /&gt;
&lt;br /&gt;
The new position of the particle that is located initially at &amp;lt;math&amp;gt;r_0=(0.5,0.5,0.5)&amp;lt;/math&amp;gt; and moves along the vector &amp;lt;math&amp;gt;v=(0.7,0.6,0.2)&amp;lt;/math&amp;gt; can be calculated by adding these two vectors (component by component). The only problem is that the box has finite dimensions (1x1x1) and each time the particle leaves the box it reenters through the opposite face. In other words, each time a coordinate reaches the value of 1, it resets to 0 and the particle keeps moving until reaching the final position. Therefore, if the addition of the components produces a number that is larger than 1 we have to subtract 1 an integer number of times.&lt;br /&gt;
&lt;br /&gt;
In this particular case, the coordinates become:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
x=0.5+0.7-1=0.2&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
y=0.5+0.6-1=0.1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
z=0.5+0.2=0.7&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=(0.2,0.1,0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reduced units==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r^{*}=\frac{r}{\sigma}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r=r^{*}\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^{*}=3.2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;r=3.2*0.34=1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;\epsilon=120*1.38*10^{-23}=1.656*10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
In &amp;lt;math&amp;gt;\frac{kJ}{mol}&amp;lt;/math&amp;gt; the well depth becomes &amp;lt;math&amp;gt;\epsilon=1.656*10^{-21}*10^{-3}*6.022*10^{23}=0.997 \frac{kJ}{mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T^{*}=\frac{k_BT}{\epsilon}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T=\frac{\epsilon T^{*}}{k_B}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;T=120*1.5=180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Equilibration=&lt;br /&gt;
&lt;br /&gt;
Giving atoms a randomly distributed positions can lead to them being positioned very close to each other in the beginning, at distances much smaller than the equilibrium distance of the Lennard-Jones potential. Consequently, they will repel violently and pick up incredible speeds, something which will make simulating a liquid impossible. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsion forces can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Number density of lattice points==&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice having a lattice constant &amp;lt;math&amp;gt;a=1.07722&amp;lt;/math&amp;gt; in reduced units can have its number density of lattice points calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{no\ of\ lattice\ points}{V}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice has 1 lattice point and a volume &amp;lt;math&amp;gt;V=a^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{1}{a^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=0.8&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a face centered cubic lattice the only difference is the number of lattice points, which is 4. &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
a=\sqrt[3] {\frac{no\ of lattice\ points}{\rho}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
a=\sqrt[3] {\frac{4}{1.2}}=1.49380&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an fcc the number of atoms created will be 4 times larger than for an sc, because an fcc has 4 lattice points, while an sc has only 1. Therefore, the command create_atoms would generate 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
The purpose of the commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is to define the mass of the atoms (in this case 1.0), to set the Lennard-Jones cutoff value (here at 3.0 in reduced units) and to define the Lennard-Jones potential parameters (\sigma and \epsilon, both set to 1.0). The Lennard-Jones cutoff value is the distance beyond which the potential is considered to be 0.&lt;br /&gt;
&lt;br /&gt;
Next, the velocity Verlet algorithm is going to be used for the simulation, because it can take the initial velocity as an input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running the simulation==&lt;br /&gt;
&lt;br /&gt;
The purpose of the second line from the following piece of code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is to define timestep as a variable that can be used anywhere in the code. Therefore, if the timestep needs to be changed for a particular simulation, the value would only need to be changed ones, not everywhere in the code.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Energybs.png|thumb|500px]|Figure 3: Energy as a function of time]]&lt;br /&gt;
|[[File: Temperaturebs.png|thumb|500px]|Figure 4: Temperature as a function of time]]&lt;br /&gt;
|[[File: Pressurebs.png|thumb|500px]|Figure 5: Pressure as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figs. 3,4 and 5 show the evolution of the energy, temperature and pressure of the system for a timestep of 0.001. As one can see, all three parameters converge. Even if they fluctuate, these fluctuations give numbers that average to a constant value. Also, the equilibration is very quick, as the time needed for these quantities to stabilize is almost nonexistent (roughly 1 unit). This means the chosen timestep is so small that it reaches equilibrium in about 1% of the total simulation time, which is 100.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Energiesbs.png|thumb|500px]|Figure 6: Energies for different timesteps as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As fig. 6 shows, the energies given by timesteps 0.001 and 0.002 almost overlap, which means that the energy corresponding to 0.001 is already very close to the real value. As the timestep increases, the predicted value of the total energy deviates more and more from the real value. However, even a timestep of 0.01 (the black curve) would work well from a practical point of view since it gives a convergent energy. In fact, this is the highest acceptable value from the 5 plotted above. A value of 0.015, on the other hand, would be totally unrealistic since it predicts a divergent energy while the total energy of the system is supposed to remain constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: So which timestep did you choose?  Average total energy should not depend on the timestep so you should choose the largest timestep which gives the same energy as smaller timesteps, in this case 0.0025.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Running simulations under specific conditions=&lt;br /&gt;
&lt;br /&gt;
The present simulations were performed at two different pressures, namely 2.0 and 3.0 in reduced units. For each of these pressures, a plot of density against temperature is shown and the results are compared to those of an ideal gas. For an ideal gas density in reduced units can be derived from the ideal gas equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
pV=Nk_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, density is given by the number of atoms per unit volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{N}{V}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equation becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p=\rho k_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{p}{k_BT}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, density scales as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{\rho^*}{\sigma^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pressure has units of force per area, which is the same as energy per volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p=p^*\frac{\epsilon}{\sigma^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T=T^*\frac{\epsilon}{k_B}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, substituting these quantities into the ideal gas law gives the expression for density in reduced units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho^*=\frac{p^*}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the temperature of the ensemble has to be changed from the current one, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to a target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, LAMMPS multiplies the velocity of every atom in the ensemble by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. The dependence of this factor on the values of the present and target temperatures can be found by expressing the kinetic energy in terms of temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum_{i}{m_iv_i^2}=\frac{3}{2}k_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
After multiplying every velocity &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; the equation becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\gamma^2}{2}\sum_{i}{m_iv_i^2}=\frac{3}{2}k_B\mathfrak{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the simple division of these two equations leads to an expression for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; in terms of the two temperatures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma^2=\frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the following piece of code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the first three values in the antepenultimate line (100, 1000, 100000) represent every how many timesteps the input values are used, the number of times the input value is used to calculate the averages and every how many timesteps the averages are calculated, respectively. In this case they are calculated at the very and, after 100000 timesteps. Because the simulation runs for 100000 timesteps and the timestep is 0.001, the simulation will take a time of 100.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is a bit unclear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Densityybs.png|thumb|500px]|Figure 7: Density as a function of temperature at different pressures ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From fig. 7 one can see that density decreases with temperature when the pressure is kept constant. This result is perfectly reasonable, because a higher temperature gives more kinetic energy to the constituent particles (also larger momentum), so in order to keep the pressure constant the density of the ensemble has to decrease. And this is expected to happen at any temperature.&lt;br /&gt;
&lt;br /&gt;
The comparison with the ideal gas law, on the other hand, seems to produce a counter-intuitive result. A gas, in general, is expected to have a lower density than a liquid, but this is not always the case. In the present situation, the pressures of the liquid is relatively large. At such values, the average separation between atoms is shorter than the equilibrium position, so the atoms repel each other. To make an ideal gas out of this system the potential energy between the particles is simply removed, so they can come very close to each other without any unfavorable energetic consequences. Again, to keep the pressure constant, the liquid must have a lower density   in order to reduce, or almost eliminate interparticle repulsion. Also, the larger the pressure, the larger the discrepancy between the simulated liquid and an ideal gas law. This discrepancy increases because at higher pressures the average interparticle separation is larger and therefore, the repulsion is stronger, wheres an ideal gas would still have no interparticle repulsion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Your simulations are above the critical temperature so you can&#039;t really distinguish between gas and liquid.  An ideal gas is a better approximation at low density when interparticle interactions are less important.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Calculating heat capacities using statistical physics=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&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;
### 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;
### 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 pressuredamp equal ${timestep}*1000&lt;br /&gt;
variable densitydamp 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 atoms equal atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal (${atoms})*(${dens})*(f_aves[8]-f_aves[7]*f_aves[7])/((${avetemp})*${avetemp})&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The piece of code shown above is quite similar to the one used to simulate at constant pressure (NPT ensemble). The main difference, however, is that the ensemble has been changed to NVT to allow a simulation at constant volume. In the end the heat capacity per volume has been calculated using the following formula (in reduced units).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{C_v}{V}=N\rho \frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its graphical representation is shown in fig. 8.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Heatcapbs.png|thumb|500px]|Figure 8: Heat capacity per volume as a function of temperature for densities of 0.2 and 0.8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The reason heat capacity decreases with temperature is that at large temperatures the density of states increases, meaning that the states come closer in energy to each other. Therefore, when the system receives a specific amount of heat, more states will get populated at high temperatures than at low temperatures (for the same amount of heat)&amp;lt;ref&amp;gt;Chueh, C. F., &amp;amp; Swanson, A. C. (1973, October). Estimation of liquid heat capacity. The Canadian Journal of Chemical Engineering. Wiley Subscription Services, Inc., A Wiley Company. https://doi.org/10.1002/cjce.5450510511&amp;lt;/ref&amp;gt;. Considering the population of energy levels is directly related to temperature through the Boltzmann distribution, at higher temperatures the same amount of heat will cause a larger increase in temperature. Therefore, the heat capacity becomes lower at higher temperatures since &amp;lt;math&amp;gt;C_v=\frac{Q}{\Delta T}&amp;lt;/math&amp;gt; for small&amp;lt;math&amp;gt;\Delta T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestions, more analysis would be needed to check this.  Why is the heat capacity larger at higher density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Structural properties and the radial distribution function=&lt;br /&gt;
&lt;br /&gt;
The shape of the radial distribution function contains a description of the structure of the ensemble. The best way of understanding what information its plot can provide is looking at its mathematical expression. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
g(r)=4\pi r^2\rho(r)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This formula reveals that places where the RDF is to 0 do not contain any particles. Conversely, if a specific radius gives a very sharp peak in the RDF this means there is an atom localized at that particular distance. In reality, on the other hand, such behavior is not seen. Depending on the phase of the system, particles can have positions more or less well defined (according to the RDF), but they are never perfectly localized. The RDF plot shows a behavior resembling the ideal situation simply because atoms cannot move freely. Even if they are not perfectly localized, they oscillate around an equilibrium point, a point which does not change. Therefore, the peaks in the RDF of the solid phase give an estimate of the equilibrium positions of the first order neighbors, second order neighbors, and so on. Therefore, if the lattice structure of the solid is known, the positions of these peaks can be used to determine the lattice parameter. In the present situation, the crystal has a face centered cubic lattice. Also, for an infinite fcc crystal, all atoms are equivalent. Therefore, the unit cell can be used to calculate these distances, and an atom in one of the corners will be taken as a starting point. Naturally, the closest neighbors are the ones in the centers of the faces, co-planar with the reference atom.. The distance to these neighbors is half the diagonal of the cube, so it will be &amp;lt;math&amp;gt;\frac{a}{\sqrt{2}}&amp;lt;/math&amp;gt;. The second nearest neighbors are those atoms located at the nearest corners, at the distance equal to the lattice parameter, &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;. Finally, the third nearest neighbors are located in the center of those faces opposite the faces of the first order neighbors. Again, some simple geometry gives the distance to these neighbors as &amp;lt;math&amp;gt;a\sqrt{1.5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The approximate positions of the first three peaks are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_1=1.025 \rightarrow a=1.450&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_2=1.445 \rightarrow a=1.445&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_3=1.775 \rightarrow a=1.449&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values are very close to the lattice constant output, which is &amp;lt;math&amp;gt;a=1.454&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
So far so good, but the integral under the RDF can also reveal important information about the system. Let us integrate it between &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{r_1} ^{r_2} g(r) dr = \int _{r_1} ^{r_2} 4 \pi r^2 \rho(r) dr = \int _{V_2 - V_1} \rho (r) dV = N_{12}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the mass of an atom is 1 for the simulated liquid, the integral between two radii, &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt; gives the number of atoms located between the spheres of radii &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Regarding the first three peaks in the RDF of the solid, their positions give the locations of the first order, second order, and third order neighbors respectively. Therefore, the integral under each of these peaks gives the number of corresponding neighbors. Looking at the values, the integral under these three peaks are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_1=12&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_2=6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_3=42&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Latticebs.PNG|thumb|500px]|Figure 9: First and second order neighbors of a face centered cubic lattice]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These values agree with the numbers of first, second and third order neighbors a face centered cubic lattice is supposed to have, the result being clearly represented in fig. 9.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to calculate the lattice parameter from each of the first three peaks and then compare with initial lattice constant, this confirms that the simulation is producing an fcc lattice. You needed to include plots of the RDF and integral of the RDF and then explain the differences between them - solid has long range order, liquid has short range order etc.  There should be 24 third nearest neighbours, not 42 (42-12-6 = 24).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Dynamical properties and the difusion coefficient=&lt;br /&gt;
&lt;br /&gt;
==Mean squared displacement==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: MSDsolidbs.png|thumb|500px]|Figure 10: Mean squared deviation as a function of timestep for a solid ]]&lt;br /&gt;
|[[File: MSDliquidbs.png|thumb|500px]|Figure 11: Mean squared deviation as a function of timestep for a liquid  ]]&lt;br /&gt;
|[[File: MSDgasbs.png|thumb|500px]|Figure 12: Mean squared deviation as a function of timestep for a gas  ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: MSDsolid1milbs.png|thumb|500px]|Figure 13: Mean squared deviation as a function of timestep for a solid from a 1 milion atom simulation  ]]&lt;br /&gt;
|[[File: MSDliquid1milbs.png|thumb|500px]|Figure 14: Mean squared deviation as a function of timestep for a liquid from a 1 milion atom simulation ]]&lt;br /&gt;
|[[File: MSDgas1milbs.png|thumb|500px]|Figure 15: Mean squared deviation as a function of timestep for a gas from a 1 milion atom simulation ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figs. 10 to 15 show the evolution of the MSD with timestep for all three phases. The reason this quantity is so important is that it can be used to estimate the diffusion coefficient using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D=\frac{1}{6} \frac{d&amp;lt;r^2&amp;gt;}{dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulated data will give a diffusion coefficient in reduced units (for length) squared per timestep. Even so, these simulations still have the power to predict the differences between diffusion through a solid, liquid and gas respectively.&lt;br /&gt;
&lt;br /&gt;
Just by having a quick look at the graphs one can see that for solids and liquids the mean squared deviation stabilizes very quickly. This happens because the initial configurations of the particles are cubic lattices, and the solid has an equilibrium structure which is very close to this idealized structure, represented by the lattice. The liquid is not very far away from the lattice either, but for this phase the positions of the atoms inside the lattice are no longer well defined. In fact, this also leads to a deformation of the lattice, which is responsible for liquid flow. &lt;br /&gt;
For a gas, on the other hand, the diffusion coefficient (proportional to the slope of the MSD) stabilizes more slowly, because the gas has a lower density than the liquid, so the particles in the system has to travel more (on average) in order to make the substance homogeneous. Finally, the average slopes for the three phases show that for solids the diffusion coefficient is effectively 0, which is correct, considering that nothing diffuses through a solid in a reasonable amount of time. For liquids and gases the simulation shows a constant diffusion coefficient, larger for gasses than for liquids. Again, this is perfectly reasonable. Estimates of the diffusion coefficients and their standard deviations from the plots shown above (for 1 milion atoms) are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{solid}=-1.6550*10^{-8}\ \ \ \ std=1.42*10^{-10}\ \ \ (effectively\ 0)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{liquid}=1.7166*10^{-4}\ \ \ \ \ std=2.78*10^{-8}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{gas}=0.0060\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std=3.50*10^{-6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit that you used to calculate D on the graphs, did you just fit to the linear part?  The gas MSD takes longer before it becomes linear because collisions are more infrequent, not because particles begin on a lattice, initially the gas motion is ballistic, not diffusive.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Velocity autocorrelation function==&lt;br /&gt;
&lt;br /&gt;
The normalized velocity autocorrelation function is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\int _{-\infty} ^{\infty} v(t)v(t+\tau) dt}{\int _{-\infty} ^{\infty} v^2(t) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the 1D harmonic oscillator the velocity is given by the derivative of the position with respect to time, so it is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
v(t)=- \omega A \sin(\omega t+\phi)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The autocorrelation function then becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\omega ^2 A^2 \int _{-\infty} ^{\infty} \sin(\omega t+\phi) \sin(\omega t+\phi +\omega \tau) dt}{\omega^2 A^2 \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\int _{-\infty} ^{\infty} \sin(\omega t+\phi) \sin(\omega t+\phi +\omega \tau) dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)= \frac{\int _{-\infty} ^{\infty} \sin(\omega t+\phi)[\sin(\omega t+\phi) \cos(\omega \tau)+\sin(\omega \tau) \cos(\omega t+\phi)] dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)= \frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi)dt+\sin(\omega \tau)\int _{-\infty} ^{\infty} \sin(\omega t+\phi) \cos(\omega t+\phi)dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt+\frac{1}{2} \sin(\omega \tau) \int _{-\infty} ^{\infty} \sin[2(\omega t+\phi) dt]}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}+\frac{\sin(\omega \tau) \int _{-\infty} ^{\infty} \sin[2(\omega t+\phi)]dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculating the first integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;THeraputic horticulture learning difficulties&lt;br /&gt;
\int _{-\infty} ^{\infty} \sin[2(\omega t+\phi)] dt=\frac{1}{2\omega} \int _{-\infty} ^{\infty} \sin(x) dx =0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral above is 0 because the integrand is an odd function and the integration interval is symmetric with respect to the origin. Therefore, only the first term remains, so the autocorrelation function becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\lim _{n\rightarrow \infty} \frac{\cos(\omega \tau) \int _{-n\pi} ^{n\pi} \sin^2(\omega t+\phi) dt}{\int _{-n\pi} ^{n\pi} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\cos(\omega \tau)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: VACFbs.png|thumb|500px]|Figure 16: Velocity autocorrelation function for the solid, liquid and harmonic oscillator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The fact that the VACFs go to 0 for the solid and liquid phases is caused by collisions between the constituent particles. Upon many of these collisions velocities start taking random values and orientations, they are no longer correlated. However, atom vibrations in a solid are quite ordered, so the solid VACF does not approach 0 that quickly. For liquid, on the other hand, the motion is less ordered, so the VACF bacomes almost 0 immediately after the first peak occurs. From the harmonic motion it can be seen that the minima in the autocorrelation function occur at the moment when the spring attached to the oscillating is at maximum compression. Immediately after such a minimum the spring starts expanding. Consequently, the position of the first peak both in the solid and liquid VACF is an estimate of the time of the first collision. A 1D harmonic oscillator can vibrate at only one frequency at a time. This can also be seen from the Fourier transform of the autocorrelation function, which is known to be a delta function centered at that particular frequency. If the solid is approximated to a series of masses linked by springs (Einstein condensate) then it becomes obvious that it can have more than one vibrational frequency. In fact, this can be seen in the Fourier transform of the VACF, which gives an entire range of frequencies, and has an amplitude proportional to the number of states corresponding to each frequency. The Fourier transforms are shown in Fig. 17.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: FFTbss.png|thumb|500px]|Figure 17: Fourier transforms of the VACFs of the solid and liquid phases]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice idea to calculate the Fourier transforms, but did you plot the running integral of the VACF or calculate the diffusion coefficients from the running integrals?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Liquid_simulations&amp;diff=596450</id>
		<title>Talk:Mod:Liquid simulations</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Liquid_simulations&amp;diff=596450"/>
		<updated>2017-03-08T02:12:56Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General commentsː Some graphs and parts of questions missing.  Make sure you answer the question in full before adding extra results.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General commentsː Some graphs and parts of questions missing.  Make sure you answer the question in full before adding extra results.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Introduction to molecular dynamics simulation=&lt;br /&gt;
&lt;br /&gt;
==Verlet algorithm for the 1D harmonic oscillator==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Oscmaximabs.PNG|thumb|500px]|Figure1: Error maxima as a function of time ]]&lt;br /&gt;
|[[File: Oscenergybs.PNG|thumb|500px]|Figure2: Total energy as a function of time ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Fig. 1 shows the energy error maxima in time for a timestep of 0.1. As one can see from the figure itself, all the maxima lie on a straight line. The particular line &amp;lt;math&amp;gt;y=4*10^{-7} x-7*10^{-5}&amp;lt;/math&amp;gt; gives a perfect fit.&lt;br /&gt;
From a practical point of view, however, a timestep this small is not necessary. It is important to note that the total energy of a harmonic oscillator is constant in time, so a fluctuation of 1% is good enough for practical purposes. If the error is too large or, even worse, it does not converge, the simulation becomes unrealistic (useless). Different timesteps have been tried and 0.2 is the largest acceptable timestep. This is because it gives a 1% maximum error in total energy, as fig. 2 shows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The fit isn&#039;t perfect if you look to more than 1 s.f.  Good choice of timestep, how many others did you try?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Lennard-Jones potential==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r)=4\epsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_0)=0 &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^6}{r_0^6}=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^{12}}{r_0^{12}}=\frac{\sigma^6}{r_0^6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^6}{r_0^6}=1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma}{r_0}=1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_0=\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This potential energy creates a conservative force field. Therefore, the force at any distance &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; can be linked to the potential energy at the same distance by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=-\frac{d\phi}{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=4\epsilon(-12\frac{\sigma^{12}}{r^{13}}+6\frac{\sigma^6}{r^7})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r)=24\epsilon(\frac{\sigma^6}{r^7}-2\frac{\sigma^{12}}{r^{13}})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At separation &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; this force is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(\sigma)=24\epsilon(\frac{\sigma^6}{\sigma^7}-2\frac{\sigma^{12}}{\sigma^{13}})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(\sigma)=-24\frac{\epsilon}{\sigma}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium position, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, is the position where the force is zero.&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_{eq})=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the equation linking force to potential energy we obtain:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
24\epsilon(\frac{\sigma^6}{r_{eq}^7}-2\frac{\sigma^{12}}{r_{eq}^{13}})=0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\sigma^6}{r_{eq}^7}=2\frac{\sigma^{12}}{r_{eq}^{13}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
1=2\frac{\sigma^6}{r_{eq}^6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}^6=2\sigma^6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=\sigma 2^{\frac{1}{6}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is given by the value of the potential at the equilibrium position, &amp;lt;math&amp;gt;\phi(r_{eq})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^6}{r_{eq}^6})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=4\epsilon(\frac{1}{4}-\frac{1}{2})&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi(r_{eq})=-\epsilon&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating some relevant integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{2\sigma}^{\infty} \phi(r) dr=4\epsilon \int _{2\sigma}^{\infty} (\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^6})=\Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{2\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*2^{11}}-\frac{1}{5*2^5})=-0.0248\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{2.5\sigma}^{\infty} \phi(r) dr = \Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{2.5\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*2.5^{11}}-\frac{1}{5*2.&lt;br /&gt;
5^5})=-0.008\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{3\sigma}^{\infty} \phi(r) dr = \Big[4\epsilon(-\frac{\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5})\Big]_{3\sigma}^{\infty}=4\epsilon\sigma(\frac{1}{11*3^{11}}-\frac{1}{5*3^5})=-0.0032\epsilon\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;math&amp;gt;\epsilon=\sigma=1.0&amp;lt;/math&amp;gt; the integrals become -0.0248, -0.008 and -0.0032 respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Water volume==&lt;br /&gt;
&lt;br /&gt;
Under standard conditions the density of water is &amp;lt;math&amp;gt;\rho=1 \frac{g}{ml}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The volume of N=10000 molecules can be estimated as follows:&lt;br /&gt;
The number of moles is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{N}{N_A}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass is&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=n\mu_{water}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=\frac{N\mu_{water}}{N_A}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And finally, the volume can be written as&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{m}{\rho}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{N\mu_{water}}{N_A\rho}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=\frac{10000*18}{6.022*10^{23}*1}=3*10^{-19} ml&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how many water molecules are there in 1 ml of water?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Moving a particle along a vector==&lt;br /&gt;
&lt;br /&gt;
The new position of the particle that is located initially at &amp;lt;math&amp;gt;r_0=(0.5,0.5,0.5)&amp;lt;/math&amp;gt; and moves along the vector &amp;lt;math&amp;gt;v=(0.7,0.6,0.2)&amp;lt;/math&amp;gt; can be calculated by adding these two vectors (component by component). The only problem is that the box has finite dimensions (1x1x1) and each time the particle leaves the box it reenters through the opposite face. In other words, each time a coordinate reaches the value of 1, it resets to 0 and the particle keeps moving until reaching the final position. Therefore, if the addition of the components produces a number that is larger than 1 we have to subtract 1 an integer number of times.&lt;br /&gt;
&lt;br /&gt;
In this particular case, the coordinates become:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
x=0.5+0.7-1=0.2&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
y=0.5+0.6-1=0.1&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
z=0.5+0.2=0.7&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So the final position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=(0.2,0.1,0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Reduced units==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r^{*}=\frac{r}{\sigma}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r=r^{*}\sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^{*}=3.2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;r=3.2*0.34=1.088 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; in real units is &amp;lt;math&amp;gt;\epsilon=120*1.38*10^{-23}=1.656*10^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
In &amp;lt;math&amp;gt;\frac{kJ}{mol}&amp;lt;/math&amp;gt; the well depth becomes &amp;lt;math&amp;gt;\epsilon=1.656*10^{-21}*10^{-3}*6.022*10^{23}=0.997 \frac{kJ}{mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T^{*}=\frac{k_BT}{\epsilon}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T=\frac{\epsilon T^{*}}{k_B}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;T=120*1.5=180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Equilibration=&lt;br /&gt;
&lt;br /&gt;
Giving atoms a randomly distributed positions can lead to them being positioned very close to each other in the beginning, at distances much smaller than the equilibrium distance of the Lennard-Jones potential. Consequently, they will repel violently and pick up incredible speeds, something which will make simulating a liquid impossible. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsion forces can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Number density of lattice points==&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice having a lattice constant &amp;lt;math&amp;gt;a=1.07722&amp;lt;/math&amp;gt; in reduced units can have its number density of lattice points calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{no\ of\ lattice\ points}{V}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice has 1 lattice point and a volume &amp;lt;math&amp;gt;V=a^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{1}{a^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=0.8&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a face centered cubic lattice the only difference is the number of lattice points, which is 4. &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
a=\sqrt[3] {\frac{no\ of lattice\ points}{\rho}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
a=\sqrt[3] {\frac{4}{1.2}}=1.49380&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an fcc the number of atoms created will be 4 times larger than for an sc, because an fcc has 4 lattice points, while an sc has only 1. Therefore, the command create_atoms would generate 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
The purpose of the commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is to define the mass of the atoms (in this case 1.0), to set the Lennard-Jones cutoff value (here at 3.0 in reduced units) and to define the Lennard-Jones potential parameters (\sigma and \epsilon, both set to 1.0). The Lennard-Jones cutoff value is the distance beyond which the potential is considered to be 0.&lt;br /&gt;
&lt;br /&gt;
Next, the velocity Verlet algorithm is going to be used for the simulation, because it can take the initial velocity as an input.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, why is a cutoff used for this potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running the simulation==&lt;br /&gt;
&lt;br /&gt;
The purpose of the second line from the following piece of code &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
is to define timestep as a variable that can be used anywhere in the code. Therefore, if the timestep needs to be changed for a particular simulation, the value would only need to be changed ones, not everywhere in the code.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Energybs.png|thumb|500px]|Figure 3: Energy as a function of time]]&lt;br /&gt;
|[[File: Temperaturebs.png|thumb|500px]|Figure 4: Temperature as a function of time]]&lt;br /&gt;
|[[File: Pressurebs.png|thumb|500px]|Figure 5: Pressure as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figs. 3,4 and 5 show the evolution of the energy, temperature and pressure of the system for a timestep of 0.001. As one can see, all three parameters converge. Even if they fluctuate, these fluctuations give numbers that average to a constant value. Also, the equilibration is very quick, as the time needed for these quantities to stabilize is almost nonexistent (roughly 1 unit). This means the chosen timestep is so small that it reaches equilibrium in about 1% of the total simulation time, which is 100.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Energiesbs.png|thumb|500px]|Figure 6: Energies for different timesteps as a function of time]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As fig. 6 shows, the energies given by timesteps 0.001 and 0.002 almost overlap, which means that the energy corresponding to 0.001 is already very close to the real value. As the timestep increases, the predicted value of the total energy deviates more and more from the real value. However, even a timestep of 0.01 (the black curve) would work well from a practical point of view since it gives a convergent energy. In fact, this is the highest acceptable value from the 5 plotted above. A value of 0.015, on the other hand, would be totally unrealistic since it predicts a divergent energy while the total energy of the system is supposed to remain constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: So which timestep did you choose?  Average total energy should not depend on the timestep so you should choose the largest timestep which gives the same energy as smaller timesteps, in this case 0.0025.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Running simulations under specific conditions=&lt;br /&gt;
&lt;br /&gt;
The present simulations were performed at two different pressures, namely 2.0 and 3.0 in reduced units. For each of these pressures, a plot of density against temperature is shown and the results are compared to those of an ideal gas. For an ideal gas density in reduced units can be derived from the ideal gas equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
pV=Nk_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here, density is given by the number of atoms per unit volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{N}{V}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equation becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p=\rho k_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{p}{k_BT}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In reduced units, density scales as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho=\frac{\rho^*}{\sigma^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pressure has units of force per area, which is the same as energy per volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
p=p^*\frac{\epsilon}{\sigma^3}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
T=T^*\frac{\epsilon}{k_B}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, substituting these quantities into the ideal gas law gives the expression for density in reduced units.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho^*=\frac{p^*}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the temperature of the ensemble has to be changed from the current one, &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to a target temperature, &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, LAMMPS multiplies the velocity of every atom in the ensemble by a factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. The dependence of this factor on the values of the present and target temperatures can be found by expressing the kinetic energy in terms of temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum_{i}{m_iv_i^2}=\frac{3}{2}k_BT&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
After multiplying every velocity &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; the equation becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\gamma^2}{2}\sum_{i}{m_iv_i^2}=\frac{3}{2}k_B\mathfrak{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the simple division of these two equations leads to an expression for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; in terms of the two temperatures.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma^2=\frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the following piece of code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press density&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the first three values in the antepenultimate line (100, 1000, 100000) represent every how many timesteps the input values are used, the number of times the input value is used to calculate the averages and every how many timesteps the averages are calculated, respectively. In this case they are calculated at the very and, after 100000 timesteps. Because the simulation runs for 100000 timesteps and the timestep is 0.001, the simulation will take a time of 100.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is a bit unclear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Densityybs.png|thumb|500px]|Figure 7: Density as a function of temperature at different pressures ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From fig. 7 one can see that density decreases with temperature when the pressure is kept constant. This result is perfectly reasonable, because a higher temperature gives more kinetic energy to the constituent particles (also larger momentum), so in order to keep the pressure constant the density of the ensemble has to decrease. And this is expected to happen at any temperature.&lt;br /&gt;
&lt;br /&gt;
The comparison with the ideal gas law, on the other hand, seems to produce a counter-intuitive result. A gas, in general, is expected to have a lower density than a liquid, but this is not always the case. In the present situation, the pressures of the liquid is relatively large. At such values, the average separation between atoms is shorter than the equilibrium position, so the atoms repel each other. To make an ideal gas out of this system the potential energy between the particles is simply removed, so they can come very close to each other without any unfavorable energetic consequences. Again, to keep the pressure constant, the liquid must have a lower density   in order to reduce, or almost eliminate interparticle repulsion. Also, the larger the pressure, the larger the discrepancy between the simulated liquid and an ideal gas law. This discrepancy increases because at higher pressures the average interparticle separation is larger and therefore, the repulsion is stronger, wheres an ideal gas would still have no interparticle repulsion.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Your simulations are above the critical temperature so you can&#039;t really distinguish between gas and liquid.  An ideal gas is a better approximation at low density when interparticle interactions are less important.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Calculating heat capacities using statistical physics=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
lattice sc ${density}&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;
### 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;
### 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 pressuredamp equal ${timestep}*1000&lt;br /&gt;
variable densitydamp 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 atoms equal atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
variable energy2 equal etotal*etotal&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcap equal (${atoms})*(${dens})*(f_aves[8]-f_aves[7]*f_aves[7])/((${avetemp})*${avetemp})&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The piece of code shown above is quite similar to the one used to simulate at constant pressure (NPT ensemble). The main difference, however, is that the ensemble has been changed to NVT to allow a simulation at constant volume. In the end the heat capacity per volume has been calculated using the following formula (in reduced units).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{C_v}{V}=N\rho \frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Its graphical representation is shown in fig. 8.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Heatcapbs.png|thumb|500px]|Figure 8: Heat capacity per volume as a function of temperature for densities of 0.2 and 0.8]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The reason heat capacity decreases with temperature is that at large temperatures the density of states increases, meaning that the states come closer in energy to each other. Therefore, when the system receives a specific amount of heat, more states will get populated at high temperatures than at low temperatures (for the same amount of heat)&amp;lt;ref&amp;gt;Chueh, C. F., &amp;amp; Swanson, A. C. (1973, October). Estimation of liquid heat capacity. The Canadian Journal of Chemical Engineering. Wiley Subscription Services, Inc., A Wiley Company. https://doi.org/10.1002/cjce.5450510511&amp;lt;/ref&amp;gt;. Considering the population of energy levels is directly related to temperature through the Boltzmann distribution, at higher temperatures the same amount of heat will cause a larger increase in temperature. Therefore, the heat capacity becomes lower at higher temperatures since &amp;lt;math&amp;gt;C_v=\frac{Q}{\Delta T}&amp;lt;/math&amp;gt; for small&amp;lt;math&amp;gt;\Delta T&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestions, more analysis would be needed to check this.  Why is the heat capacity larger at higher density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Structural properties and the radial distribution function=&lt;br /&gt;
&lt;br /&gt;
The shape of the radial distribution function contains a description of the structure of the ensemble. The best way of understanding what information its plot can provide is looking at its mathematical expression. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
g(r)=4\pi r^2\rho(r)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This formula reveals that places where the RDF is to 0 do not contain any particles. Conversely, if a specific radius gives a very sharp peak in the RDF this means there is an atom localized at that particular distance. In reality, on the other hand, such behavior is not seen. Depending on the phase of the system, particles can have positions more or less well defined (according to the RDF), but they are never perfectly localized. The RDF plot shows a behavior resembling the ideal situation simply because atoms cannot move freely. Even if they are not perfectly localized, they oscillate around an equilibrium point, a point which does not change. Therefore, the peaks in the RDF of the solid phase give an estimate of the equilibrium positions of the first order neighbors, second order neighbors, and so on. Therefore, if the lattice structure of the solid is known, the positions of these peaks can be used to determine the lattice parameter. In the present situation, the crystal has a face centered cubic lattice. Also, for an infinite fcc crystal, all atoms are equivalent. Therefore, the unit cell can be used to calculate these distances, and an atom in one of the corners will be taken as a starting point. Naturally, the closest neighbors are the ones in the centers of the faces, co-planar with the reference atom.. The distance to these neighbors is half the diagonal of the cube, so it will be &amp;lt;math&amp;gt;\frac{a}{\sqrt{2}}&amp;lt;/math&amp;gt;. The second nearest neighbors are those atoms located at the nearest corners, at the distance equal to the lattice parameter, &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt;. Finally, the third nearest neighbors are located in the center of those faces opposite the faces of the first order neighbors. Again, some simple geometry gives the distance to these neighbors as &amp;lt;math&amp;gt;a\sqrt{1.5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The approximate positions of the first three peaks are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_1=1.025 \rightarrow a=1.450&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_2=1.445 \rightarrow a=1.445&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_3=1.775 \rightarrow a=1.449&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values are very close to the lattice constant output, which is &amp;lt;math&amp;gt;a=1.454&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
So far so good, but the integral under the RDF can also reveal important information about the system. Let us integrate it between &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int _{r_1} ^{r_2} g(r) dr = \int _{r_1} ^{r_2} 4 \pi r^2 \rho(r) dr = \int _{V_2 - V_1} \rho (r) dV = N_{12}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the mass of an atom is 1 for the simulated liquid, the integral between two radii, &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt; gives the number of atoms located between the spheres of radii &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Regarding the first three peaks in the RDF of the solid, their positions give the locations of the first order, second order, and third order neighbors respectively. Therefore, the integral under each of these peaks gives the number of corresponding neighbors. Looking at the values, the integral under these three peaks are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_1=12&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_2=6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
I_3=42&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: Latticebs.PNG|thumb|500px]|Figure 9: First and second order neighbors of a face centered cubic lattice]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These values agree with the numbers of first, second and third order neighbors a face centered cubic lattice is supposed to have, the result being clearly represented in fig. 9.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to calculate the lattice parameter from each of the first three peaks and then compare with initial lattice constant, this confirms that the simulation is producing an fcc lattice. You needed to include plots of the RDF and integral of the RDF and then explain the differences between them - solid has long range order, liquid has short range order etc.  There should be 24 third nearest neighbours, not 42 (42-12-6 = 24).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Dynamical properties and the difusion coefficient=&lt;br /&gt;
&lt;br /&gt;
==Mean squared displacement==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: MSDsolidbs.png|thumb|500px]|Figure 10: Mean squared deviation as a function of timestep for a solid ]]&lt;br /&gt;
|[[File: MSDliquidbs.png|thumb|500px]|Figure 11: Mean squared deviation as a function of timestep for a liquid  ]]&lt;br /&gt;
|[[File: MSDgasbs.png|thumb|500px]|Figure 12: Mean squared deviation as a function of timestep for a gas  ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: MSDsolid1milbs.png|thumb|500px]|Figure 13: Mean squared deviation as a function of timestep for a solid from a 1 milion atom simulation  ]]&lt;br /&gt;
|[[File: MSDliquid1milbs.png|thumb|500px]|Figure 14: Mean squared deviation as a function of timestep for a liquid from a 1 milion atom simulation ]]&lt;br /&gt;
|[[File: MSDgas1milbs.png|thumb|500px]|Figure 15: Mean squared deviation as a function of timestep for a gas from a 1 milion atom simulation ]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Figs. 10 to 15 show the evolution of the MSD with timestep for all three phases. The reason this quantity is so important is that it can be used to estimate the diffusion coefficient using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D=\frac{1}{6} \frac{d&amp;lt;r^2&amp;gt;}{dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulated data will give a diffusion coefficient in reduced units (for length) squared per timestep. Even so, these simulations still have the power to predict the differences between diffusion through a solid, liquid and gas respectively.&lt;br /&gt;
&lt;br /&gt;
Just by having a quick look at the graphs one can see that for solids and liquids the mean squared deviation stabilizes very quickly. This happens because the initial configurations of the particles are cubic lattices, and the solid has an equilibrium structure which is very close to this idealized structure, represented by the lattice. The liquid is not very far away from the lattice either, but for this phase the positions of the atoms inside the lattice are no longer well defined. In fact, this also leads to a deformation of the lattice, which is responsible for liquid flow. &lt;br /&gt;
For a gas, on the other hand, the diffusion coefficient (proportional to the slope of the MSD) stabilizes more slowly, because the gas has a lower density than the liquid, so the particles in the system has to travel more (on average) in order to make the substance homogeneous. Finally, the average slopes for the three phases show that for solids the diffusion coefficient is effectively 0, which is correct, considering that nothing diffuses through a solid in a reasonable amount of time. For liquids and gases the simulation shows a constant diffusion coefficient, larger for gasses than for liquids. Again, this is perfectly reasonable. Estimates of the diffusion coefficients and their standard deviations from the plots shown above (for 1 milion atoms) are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{solid}=-1.6550*10^{-8}\ \ \ \ std=1.42*10^{-10}\ \ \ (effectively\ 0)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{liquid}=1.7166*10^{-4}\ \ \ \ \ std=2.78*10^{-8}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D_{gas}=0.0060\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std=3.50*10^{-6}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit that you used to calculate D on the graphs, did you just fit to the linear part?  The gas MSD takes longer before it becomes linear because collisions are more infrequent, not because particles begin on a lattice, initially the gas motion is ballistic, not diffusive.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Velocity autocorrelation function==&lt;br /&gt;
&lt;br /&gt;
The normalized velocity autocorrelation function is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\int _{-\infty} ^{\infty} v(t)v(t+\tau) dt}{\int _{-\infty} ^{\infty} v^2(t) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the 1D harmonic oscillator the velocity is given by the derivative of the position with respect to time, so it is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
v(t)=- \omega A \sin(\omega t+\phi)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The autocorrelation function then becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\omega ^2 A^2 \int _{-\infty} ^{\infty} \sin(\omega t+\phi) \sin(\omega t+\phi +\omega \tau) dt}{\omega^2 A^2 \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\int _{-\infty} ^{\infty} \sin(\omega t+\phi) \sin(\omega t+\phi +\omega \tau) dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)= \frac{\int _{-\infty} ^{\infty} \sin(\omega t+\phi)[\sin(\omega t+\phi) \cos(\omega \tau)+\sin(\omega \tau) \cos(\omega t+\phi)] dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)= \frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi)dt+\sin(\omega \tau)\int _{-\infty} ^{\infty} \sin(\omega t+\phi) \cos(\omega t+\phi)dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt+\frac{1}{2} \sin(\omega \tau) \int _{-\infty} ^{\infty} \sin[2(\omega t+\phi) dt]}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\frac{\cos(\omega \tau) \int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}+\frac{\sin(\omega \tau) \int _{-\infty} ^{\infty} \sin[2(\omega t+\phi)]dt}{\int _{-\infty} ^{\infty} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Calculating the first integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;THeraputic horticulture learning difficulties&lt;br /&gt;
\int _{-\infty} ^{\infty} \sin[2(\omega t+\phi)] dt=\frac{1}{2\omega} \int _{-\infty} ^{\infty} \sin(x) dx =0&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral above is 0 because the integrand is an odd function and the integration interval is symmetric with respect to the origin. Therefore, only the first term remains, so the autocorrelation function becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\lim _{n\rightarrow \infty} \frac{\cos(\omega \tau) \int _{-n\pi} ^{n\pi} \sin^2(\omega t+\phi) dt}{\int _{-n\pi} ^{n\pi} \sin^2(\omega t+\phi) dt}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C(\tau)=\cos(\omega \tau)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: VACFbs.png|thumb|500px]|Figure 16: Velocity autocorrelation function for the solid, liquid and harmonic oscillator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The fact that the VACFs go to 0 for the solid and liquid phases is caused by collisions between the constituent particles. Upon many of these collisions velocities start taking random values and orientations, they are no longer correlated. However, atom vibrations in a solid are quite ordered, so the solid VACF does not approach 0 that quickly. For liquid, on the other hand, the motion is less ordered, so the VACF bacomes almost 0 immediately after the first peak occurs. From the harmonic motion it can be seen that the minima in the autocorrelation function occur at the moment when the spring attached to the oscillating is at maximum compression. Immediately after such a minimum the spring starts expanding. Consequently, the position of the first peak both in the solid and liquid VACF is an estimate of the time of the first collision. A 1D harmonic oscillator can vibrate at only one frequency at a time. This can also be seen from the Fourier transform of the autocorrelation function, which is known to be a delta function centered at that particular frequency. If the solid is approximated to a series of masses linked by springs (Einstein condensate) then it becomes obvious that it can have more than one vibrational frequency. In fact, this can be seen in the Fourier transform of the VACF, which gives an entire range of frequencies, and has an amplitude proportional to the number of states corresponding to each frequency. The Fourier transforms are shown in Fig. 17.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[File: FFTbss.png|thumb|500px]|Figure 17: Fourier transforms of the VACFs of the solid and liquid phases]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice idea to calculate the Fourier transforms, but did you plot the running integral of the VACF or calculate the diffusion coefficients from the running integrals?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=References=&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=594714</id>
		<title>Talk:Mod:gogle14</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=594714"/>
		<updated>2017-03-06T05:55:39Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted and results look good, but some of the written explanations are a bit unclear.  Make sure that you understand the background theory behind each task and use this in your answers.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Introduction to molecular dynamics simulations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of velocity-Verlet integration method&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Verlet algorithm can be used to estimate positions, velocities and momenta of particles without the need of continuous integration. Instead, it uses the knowledge of those values at previous points and Taylor expansion to find all of these values at set intervals (timesteps). Below is a comparison of the function &amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;A=1, \omega =1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi =0&amp;lt;/math&amp;gt;, therefore the function is &amp;lt;math&amp;gt;x(t)=\cos t&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_analytical_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 1.&amp;lt;/b&amp;gt; Comparison of veloity-Verlet and analytical solution of the function.&lt;br /&gt;
&lt;br /&gt;
As can be seen from Figure 1, the results generated by Verlet algorithm match the analytical values closely, indicating how powerful this approximation is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Still, there is some discrepancy present, as indicated in Figure 2 below:&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_error_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 2.&amp;lt;/b&amp;gt; Error analysis for the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
It can be seen that the error shows an oscillating behaviour (Figure 2), with the local maximum of the error growing consistently over time. This is due to the fact that the Taylor series converge to the real value, but not all terms were taken into account; the first maximum occurs where the fourth term (error term) is the largest. As previous values are used to calculate those at the next timestep, the error is cumulative and therefore increases over time, as predicted by the curve in the graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_energy_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 3.&amp;lt;/b&amp;gt; Total energy as a function of time for velocity-Verlet method.&lt;br /&gt;
&lt;br /&gt;
Another way of evaluating the usefulness of this algorithm is by seeing how well the predicted values match known values. As an isolated system is modelled, the total energy in the system should remain constant. However, Figure 3 shows that this is not the case and there are small (0.25%) fluctuations from the real value when the timestep of 0.1 is used. This shows that the system, though faithful, is still a simplification of reality, furthermore, it can tolerate even a larger timestep and thus fewer calculations, as 1% error is exceeded only when the timestep is increased to 0.2. This could save computational resources, but it also indicates the balance between the choice of timestep and the correspondence of the model to reality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Evaluation of the system used&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=4\epsilon \bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;, multiply by &amp;lt;math&amp;gt;\frac {r_0^6}{\sigma ^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\frac{\sigma^{6}}{r_0^{6}}-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}}=1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0^{6}=\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;or&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=-\sigma &amp;lt;/math&amp;gt; (root invalid, as separation has to &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
This is the separation at which potential energy is 0; the force at this separation is as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F=-\frac{d \phi (r)}{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-\frac {4\epsilon \Big( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}} \Big) }{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-4 \epsilon \bigg( -12 \frac {\sigma ^{12}}{r_0^{13}} +6 \frac{\sigma ^6}{r_0^7} \bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=48 \epsilon \frac {\sigma ^{12}}{r_0^{13}} -24 \epsilon \frac {\sigma ^6}{r_0^7}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know that &amp;lt;math&amp;gt;r_0= \sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)= \frac {48 \epsilon }{\sigma }- \frac {24 \epsilon }{\sigma }= \frac {24 \epsilon}{\sigma }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A system is said to be an equilibrium when there is no net force acting on it, i.e., the force is 0. By substituting minimum potential energy expression from above into the minimum force expression, the following formula is obtained:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F_{eq}=48 \epsilon \frac {\sigma ^{12}}{r_{eq}^{13}} -24 \epsilon \frac {\sigma ^6}{r_{eq}^7}=0&lt;br /&gt;
&amp;lt;/math&amp;gt;, divide by &amp;lt;math&amp;gt;24 \epsilon \frac {\sigma ^6}{r_{eq}^7} &amp;lt;/math&amp;gt; and rearrange:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}^6=2\sigma ^6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=+\sqrt[6]{2} \sigma \approx 1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=-\sqrt[6]{2} \sigma \approx -1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt; (root invalid, separation has to be &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
The depth of well characterises how stable the system is. For the equilibrium distance it can be found by substituting the equilibrium &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; value into the Lennard-Jones interaction equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r_{eq})=4 \epsilon \bigg( \frac{\sigma ^{12}}{(\sqrt[6]{2}\sigma)^{12}}-\frac{\sigma ^{6}}{(\sqrt[6]{2}\sigma)^{6}} \bigg)=4 \epsilon \Big( \frac{1}{4} - \frac{1}{2} \Big)=4 \epsilon \Big( - \frac{1}{4} \Big)=-\epsilon&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To evaluate the integral of the potential energy of the Lennard-Jones potential, let us set the changing lower bound to a value n, which can later be substituted for the necessary value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} \phi (r) dr=\int_{n}^{\infty} 4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg) dr&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon =\sigma =1&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} 4 \bigg( \frac{1}{r^{12}}-\frac{1}{r^{6}}\bigg) dr=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
4\bigg[ \frac {1}{5r^5}- \frac {1}{11r^{11}} \bigg]_n^{\infty}=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( [0]- \bigg( \frac{1}{5n^5} -\frac {1}{11n^{11}} \bigg) \bigg)=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( \frac {1}{11n^{11}}-\frac {1}{5n^5} \bigg) \approx -\frac {4}{5n^5}  &lt;br /&gt;
&amp;lt;/math&amp;gt;, as first term becomes negligible&lt;br /&gt;
&lt;br /&gt;
Let us substitute in the lower bound values (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is still 1):&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2.5 \sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=3\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to understand the scale of the system, let us compare the number of water particles in 1 mL of water to the volume of water that could be simulated. The number of water particles in 1 mL of water under standard conditions can be determined like this&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=\rho \times V=0.9982 \times 1=0.9982 (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{m}{N}=\frac{0.9982}{18.02}=5.539 \times 10^{-2}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N=n \times N_A=5.539 \times 10^{-2} \times 6.023 \times 10^{23}=3.336 \times 10^{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Meanwhile, 10000 molecules of water occupy this volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{N}{N_A}=\frac{10000}{6.023 \times 10^{23}}=1.660 \times 10^{-20}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=n \times M=18.02 \times 1.660 \times 10^{-20}=2.989 \times 10^{-19} (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=m \times \rho=2.989 \times 10^{-19} \times 0.9982=2.983 \times 10^{-19} (mL)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From these results it can be seen that the volumes simulated are absolutely minuscule: 18 orders of magnitude less than a single mL of water. However, even such small amounts are enough to provide us with values applicable to the macroscopic world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system also uses boundary conditions in order to ensure that the simulated environment is close to reality while also being easy to simulate&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
(0.5, 0.5, 0.5)+&lt;br /&gt;
(0.7, 0.6, 0.2)=&lt;br /&gt;
(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;, which is &lt;br /&gt;
&amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
after applying boundary conditions according to which each atom regenerates at the opposite into the cube each time it crosses its boundaries; no coordinate can exceed 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These simulations also make use of reduced units. It is done purely out of convenience so that the output and input could be as close to easily operable numbers while also having a physical meaning. For example, conversion from reduced to real units for Argon can be achieved as follows:&lt;br /&gt;
&lt;br /&gt;
1)Lennard-Jones cutoff distance of 3.2 units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r*\sigma=3.2 \times 3.4\times 10^{-10}=1.09 \times 10^{-9} (m)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)Well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_{well}=-\epsilon =120\times k_b \times N_A=120\times R=120 \times 8.31=998 (J\ \ mol^{-1})=0.998 (kJ\ \ mol^{-1})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)Temperature of 1.5 reduced units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac {\epsilon T*}{k_B}=1.5 \times 120=180 (K)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Equilibriation&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A randomly generated grouping of atoms can (and, with a large number of generated atoms, likely will) occupy thermodynamically unfeasible positions, for example, they might have overlapping van der Waals radii if generated in close proximity, which would give the atoms a larger potential energy and see them repel strongly (large kinetic energy) once the simulation is started. In normal situations the kinetic temperatures would be described by the Maxwell-Boltzmann distribution, but in the artificially created system it therefore might not be the case. In reality, all atoms occupy space and have velocities and momenta starting from a realistic previous thermodynamic state; for this reason it is better to simulate the melting of a crystal, where the initial positions can be simulated to match reality closely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsion forces in the initial system configuration can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density used in this simulation is number density: the number of atoms per unit volume. Let us consider a cubic unit cell, where all cell parameters are equal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho _n=\frac {N}{V}=\frac {N}{a^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number density of 0.8 gives the following cell parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{N}{\rho _n}}=\sqrt[3]{\frac{1}{0.8}}=1.07722&amp;lt;/math&amp;gt;, which matches the values given by the program&lt;br /&gt;
&lt;br /&gt;
This formula also allows to predict the side length of an fcc cell with the number density of 1.2; an fcc cell contains 4 atoms: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{4}{1.2}}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of atoms generated is dependent on the size of the box as well as the type of lattice used. For our initial box of a size of 10×10×10, 1000 unit cells were be generated. If fcc unit cells were to be generated instead, we would create 4000 atoms, as each fcc cell has 4 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
In order to run the simulation, knowledge of the code used is important. These three lines set the type of interactions the atoms will have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line sets the mass of each atom type. In this case, all atoms are type 1 and therefore mass is set to be 1.0 for all atoms&lt;br /&gt;
&lt;br /&gt;
The second line sets the type of force-field interaction and the cut-off distance after which there is considered to be no interaction. In this case, each atom pair interacts according to Lennard-Jones potential and the atoms are considered as non-interacting if the reduced distance is 3 or larger.&lt;br /&gt;
&lt;br /&gt;
The third line sets the strength of interaction between an atom pair. In this case, the two placeholder asterisks signify that any atom with any other atom interacts with a force-field coefficient of 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why is a cutoff used?  What are the forcefield coefficients considering that we&#039;re using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Considering that for each atom both a position and a velocity are set, we can conclude that the aforementioned velocity-Verlet integration algorithm will be used. In this case, the positions are set as crystal lattice points and the velocities are randomly assigned to obey the Maxwell-Boltzmann distribution, which is a feasible thermodynamic starting point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the length of equilibriation for the system can be estimated, computations can be run to cover that particular amount of time (100 units in the given case). Defining the timestep and letting the number of steps run be defined by the number of timesteps used can achieves a situation where only changing the timestep still lets the simulation run for the same amount of time, therefore making it simpler. Conversly, the other code means that each time a timestep is defined, the number of runs would also have to be entered manually in order to reach the same length of simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables makes it easy to change the value of certain parameters in the simulation, with all commands dependent on that parameter updating automatically.  Make it clear which task you are answering.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Evst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 4.&amp;lt;/b&amp;gt; Equilibriation of energy over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Tvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 5.&amp;lt;/b&amp;gt; Equilibriation of temperature over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_pvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 6.&amp;lt;/b&amp;gt; Equilibriation of pressure over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
From Figures 3, 4 and 5 it can be seen that all the calculated parameters reach an equilibrium quickly for the timestep of 0.001, which indicates that it is a particularly precise timestep to use.&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_Evst_all.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 7.&amp;lt;/b&amp;gt; Comparison of equilibriation of energy over time between different timesteps&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_table_eq_timesteps.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 8&amp;lt;/b&amp;gt; Average energy for each equilibriated timestep.&lt;br /&gt;
&lt;br /&gt;
In Figure 7 it is visible that all timesteps equal to and lower than 0.01 reach an equilibrium, meaning that they all can be used for simulations to varying degrees of success. The 0.015 timestep fails to reach an equilibrium at all and also provides a visibly different energy than the others, indicating that it cannot be used to simulate the liquids.&lt;br /&gt;
&lt;br /&gt;
From the remaining timestep values the average energies were extracted (Figure 8); it becomes evident that the difference between the 0.001 and 0.0025 timesteps is insignificant, while those for the higher timesteps are further from physical reality. Given the closeness of their results, 0.0025 timestep is a better choice than 0.001, as the same number of steps can cover 2.5 more time with a fixed number of steps simulated. Though not relevant to this particular simulation, this can become useful in situations when the system takes longer to reach an equilibrium, or to save computational resources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, average energy shouldn&#039;t depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Simulations under specific conditions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Setting up the system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We know that:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B T&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also at the end of each time step each velocity is multiplied by &amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt; to give the desired temperature &amp;lt;math&amp;gt;\mathfrak{T} &amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum _i m_i (\gamma v_i)^2=\frac{3}{2}Nk_B\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\gamma ^2}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B\mathfrak{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After dividing by the original equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma ^2=\frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the script there is a line saying:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables starting with v_ show the output values that will be generated at each set interval. The interval at which the output is given is set by the fist number following the ave/time command; in this case it is 100, meaning that the output is generated every 100 timesteps. The second number sets the number of times the input values will be used, in this case, it is 1000 times. The last number (100000) sets the frequency at which the average output values are generated. As the next line of the script is as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the average value generated will also be the overall average value, generated from 100000/100=1000 values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is a bit unclear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to compare the simulated values to the ideal gas equation, first we must rewrite it in reduced units. The ideal gas law states that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;pV=Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As&lt;br /&gt;
&amp;lt;math&amp;gt;p=p^* \frac{\epsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\frac{\epsilon}{k_B}&amp;lt;/math&amp;gt; and &lt;br /&gt;
&amp;lt;math&amp;gt;\rho =\frac {\rho ^*}{\sigma ^3}&amp;lt;/math&amp;gt;, we can substitute these values into the ideal gas equation, which gives the ideal gas equation in reduced units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=\frac{p^*}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are expressing density as a function of temperature, it is visible that reduced density is inversely proportional to reduced temperature with the gradient of reduced pressure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=p^*\times \frac{1}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of densities&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:density_vs_temp.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 9.&amp;lt;/b&amp;gt; Calculated densities at different temperatures and pressures.&lt;br /&gt;
&lt;br /&gt;
Figure 9 shows that at constant pressure, density is decreasing with temperature. Furthermore, increased pressure increases the density at the same temperature; both of these facts match the physical reality and therefore the simulation has been at least somewhat successful. However, the theoretical density values for an ideal gas are dramatically higher for the same temperature. It is due to the fact that the ideal gas equation completely ignores any intermolecular interactions, including the repulsive ones that dominate at this pressure and cause the atoms to increase their internuclear distances. As the system is warmed up, the discrepancy between both the ideal and non-ideal gas start to disappear, as at higher temperatures densities decrease, the space between atoms increase and real gases start to behave similar to ideal gases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Heat capacity&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was the code used to run the heat capacity experiments. New output variables were defined and mentions of pressure were deleted, as it is not necessary to be measured. This code was used to run the simulation at density of 0.2 and temperature of 2.2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2 &lt;br /&gt;
lattice sc ${density}&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.2&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;
reset_timestep 0&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temper equal temp&lt;br /&gt;
variable temper2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable energytotal equal etotal&lt;br /&gt;
variable energytotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temper v_dens2 v_temper2 v_energytotal v_energytotal2&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 heatcap equal ${n}*${dens}*(f_aves[6]-f_aves[5]*f_aves[5])/(f_aves[2]*f_aves[2])&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;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of the file can be viewed below:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat_cap_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 10.&amp;lt;/b&amp;gt; Heat capacity as a function of temperature at p=0.2 and p=0.8&lt;br /&gt;
&lt;br /&gt;
Both pressures show a reduction in heat capacity with increasing temperature (Figure 10). As higher heat capacity correlates with a higher number of rotational, vibrational and other thermally reachable states and more accessible degrees of freedom, it is logical that with increasing temperature the number of states accessible with further increase would drop and therefore the heat capacity would decrease (i.e., more heat energy is converted to kinetic energy in hot molecules than cold molecules). The curve at 0.8 units reduced pressure has a peculiar hump around 2.3-2.4 temperature, indicating that in those particular circumstances there is a higher density of states for some reason that would need further investigation.&lt;br /&gt;
&lt;br /&gt;
It can also be seen that larger pressure applied to a system at a certain temperature would increase the heat capacity over volume. This is due to the fact that now a unit volume contains more molecules and therefore has more accessible states. In other words, the increased pressure increases density and thus the density of states as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There is no vibrational or rotational energy in your simulations as you are just simulating spherical particles.  Particle density is not necessarily related to density of energy states.  A higher pressure and so higher density means more particles per unit volume and so more energy is required per unit volume to raise the temperature.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Radial distribution function&amp;lt;/h2&amp;gt;&lt;br /&gt;
[[File:RDF_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 11.&amp;lt;/b&amp;gt; Radial distribution function for a solid, liquid and vapour&lt;br /&gt;
&lt;br /&gt;
Simulations in Figure 11 run at density of 1.15 and temperatures of 0.07, 0.7 and 1.2 to obtain vapour, liquid and solid respectively. The radial distribution functions (RDF) of each phase show some similar features with the the values of 0 up to radii values of around 0.8, followed by one or more peaks and then largely tending to 1. The radial distribution function illustrates the probability of finding at atom at a certain distance from the origin atom. As all atoms repel over short distances, spectra for all three phases show that there there are no other atoms in direct vicinity of the origin atom. Directly outside of this sphere the probability of finding an atom is relatively large, corresponding to the attractive and repulsive parts of Lennard-Jones potential respectively. The function then tends to normalise to 1.&lt;br /&gt;
&lt;br /&gt;
However, there are marked differences in the number of peaks close to atoms in each phase. Gases only get one initial peak, as gas particles interact very weakly and have larger distances between them, therefore they do not have any long-range structure. Liquids show three discernible peaks due to the fact that there exists a short-range structure, as liquid particles are in closer proximity due to existing attractive forces between them. After that, the function tends to 1, indicating a lack of long-range structure. The solids have a large number of peaks, as they exist in crystalline forms and therefore have a large amount of both short-range and long-range structure. Crystals are periodic, therefore as the radius grows, the imaginary sphere crosses either empty space or several atoms in all directions, giving rise to many discernible peaks. Even though the RDF value tends to 1 over time, it can never reach it and shows oscillatory behaviour instead because of the high order of long-range structure present in crystals.&lt;br /&gt;
 &lt;br /&gt;
[[File:gatis_lattice_illustration.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 12.&amp;lt;/b&amp;gt; Illustration of the lattice structure.&lt;br /&gt;
&lt;br /&gt;
Illustrated above is the connectivity in the fcc lattice; the red atom is the atom of origin. It is visible that the closest atoms are located on the faces of the cube which intersect at the origin point. The distance a is half of a diagonal of the face of the cube, i.e., it is equal to &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a_l&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;a_l&amp;lt;/math&amp;gt; is the lattice parameter. The next closest atoms is the corner of the cube, and distance b is therefore equal to the lattice paramter. Third closest atoms can be found on the centres of the faces of the cube that do not contain the origin point. The distance c can be calculated as the hypotenuse of the right triangle one side of which is distance a and the other one is one side of distance b, it is therefore &amp;lt;math&amp;gt;c=\sqrt{1^2+\bigg(\frac{\sqrt{2}}{2}\bigg)^2}a_l=\sqrt{\frac{3}{2}}a_l&amp;lt;/math&amp;gt;. The positions of the first three peaks on the RDF rougly correspond to the coefficients of the theoretical distance values by a factor of 1.5, as they are at radii of 1.025, 1.475 and 1.925 respectively.&lt;br /&gt;
&lt;br /&gt;
The area under each peak is proportional to the number of atoms it corresponds to. As the origin atom is in the corner of this cube, it is also simulatanously part of &amp;lt;math&amp;gt;2^3=8&amp;lt;/math&amp;gt; cubes, and so are the atoms close to it. &lt;br /&gt;
There are 3 blue atoms in each of the 8 cubes, but each blue atom is on the face of the cube and is therefore shared between two cubes, so there are &amp;lt;math&amp;gt;\frac{3\times 8}{2}=12&amp;lt;/math&amp;gt; blue atoms coordinated with the origin atom.&lt;br /&gt;
&lt;br /&gt;
There are 3 green atoms in each of the 8 cubes in the coordination sphere, however, as each green atom is on the corner of the adjacent cubes, each of them is shared between 4 cubes in the coordination sphere, therefore &amp;lt;math&amp;gt;\frac{3\times 8}{4}=6&amp;lt;/math&amp;gt; green atoms coordinate with the origin.&lt;br /&gt;
&lt;br /&gt;
None of the orange atoms are part of another cube in the coordination sphere, therefore there are &amp;lt;math&amp;gt;3\times 8=24&amp;lt;/math&amp;gt; orange atoms within distance c of the origin atom.&lt;br /&gt;
&lt;br /&gt;
From the obtained values we can see that the intensity of each peak also mathces what is expected from theory, therefore it can be concluded that the RDF provides useful information about both long-range and short-range structure of solids.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to express the distances to the first 3 peaks in terms of the lattice parameter - calculate an average lattice parameter from this that you can compare with the value of the initial lattice. The expected number of atoms contributing to each peak are well worked out, but did you check these values with the integral of the RDF, show this graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Dynamical properties and diffusion coefficient &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Mean square displacement&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:MSD_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 13.&amp;lt;/b&amp;gt; Mean square displacement for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
In Figure 13, the calculated values are represented with a warm (red-orange-gold) colour scheme, while the given values from 1000000 atoms are shown with a cool (blue-turquoise-green) colour scheme.&lt;br /&gt;
&lt;br /&gt;
The simulated values completely correspond to what is expected from theory: in solid phase the atoms remain almost completely static due to their being in a crystal structure. In both liquid phase and vapour phase the mean square displacement (MSD) increases with time, tending towards a straight line behaviour (pure diffusive behaviour). As liquids have more attractive forces than gases and they are denser, clearly the MSD should be much lower in them than vapour phase; indeed, this behaviour is corroborated by the calculated values.&lt;br /&gt;
&lt;br /&gt;
The provided results of a simulation of 1000000 atoms shows a very similar qualitative behaviour, especially in the solid phase. The provided simulation shows a somewhat lower rate of increase in MSD than the independently run calculation with the opposite being true for the vapour phases. However, it is difficult to speculate about the reasons why this could be the case due to the uncertainty about what conditions were used in the simulations provided.&lt;br /&gt;
&lt;br /&gt;
As it is known that &amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta \langle r^2 (t)\rangle}{\delta t}&amp;lt;/math&amp;gt;, it can also be seen that the diffusion coefficient is &amp;lt;math&amp;gt;\frac{1}{6}&amp;lt;/math&amp;gt; of the gradient at the linear component of the curve. As the graph shows the gradient in the units of the timestep, each gradient has to be divided by the length of the timestep (0.002). The obtained diffusion coefficients are as shown in Figure 14:&lt;br /&gt;
&lt;br /&gt;
[[File:Dif_coef_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 14.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from the gradients of MSD functions&lt;br /&gt;
&lt;br /&gt;
As can be seen, the diffusion coefficient is negligible in solids and about an order of magnitude larger in gases than it is in liquids. A relatively good agreement between the independently simulated values and the values obtained from the provided data can be observed. As diffusion is measured in units of distance squared over time, in this case the units change depending on what the reduced length is equal to as well as the length of one time unit used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the gas MSD start off as a curved line, what does this represent?  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Velocity autocorrection function&amp;lt;/h3&amp;gt;&lt;br /&gt;
The velocity autocorrection function (VACF) for a harmonic oscillator can be solved as follows:&lt;br /&gt;
It is known that&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{v(t)v(t+\tau ) dt}}{\int_{-\infty }^{\infty}{v^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also known that harmonic oscillator is described by&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi )&amp;lt;/math&amp;gt;, which differentiates into &amp;lt;math&amp;gt;v(t)=-A\omega \sin (\omega t+\phi )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us substitute it into the autocorrection formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{A\omega \sin (\omega t+\phi )A\omega \sin (\omega (t+\tau) +\phi ) dt}}{\int_{-\infty }^{\infty}{(A\omega \sin (\omega t+\phi ))^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega ^2&amp;lt;/math&amp;gt; cancel out (constants); &amp;lt;math&amp;gt;\sin (\omega (t+\tau )+\phi )&amp;lt;/math&amp;gt; expanded as per a basic trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{\sin (\omega t+\phi )(\sin (\omega t +\phi )\cos (\omega \tau)+(\sin (\omega \tau)\cos (\omega t+\phi )) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
separate and bring out constants:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\cos (\omega \tau)\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}+\frac{\sin (\omega \tau)\int_{-\infty }^{\infty}{\sin (\omega t+\phi )\cos (\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the left hand side summand &amp;lt;math&amp;gt;\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}&amp;lt;/math&amp;gt; cancel out; in the right hand side summand the odd function&lt;br /&gt;
&amp;lt;math&amp;gt;\sin (\omega t+\phi )\cos (\omega t+\phi )&amp;lt;/math&amp;gt; is integrated over the real number axis, giving 0 as the value of the second summand. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;c(\tau )=\cos (\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, clear derivation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 15.&amp;lt;/b&amp;gt; Velocity autocorrection functions for a liquid, a solid and a harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
As is seen in the Figure 15, both for the liquid and the gas VACF values start high and then with different degrees of oscillatory behaviour approach 0, which means complete lack of correlation. It makes physical sense, as in the beginning the original velocity is the only velocity, but its effect starts to decrease as kinetic energy either is lost to rotational/vibrational energy or is affected by collisions with other particles. Subsequently, the harmonic oscillator correctly predicts oscillations and both liquids and gases tend to change their velocity over time until the original velocity has very little impact on the final velocity. The difference lies in the fact that for solids the oscillation phase lasts much longer, while liquids tend to decorrelate faster. This is due to liquids being in a less structured environment with a larger risk of collision, while for solids in crystalline environments collisions are more limited and they have less kinetic energy, therefore it takes longer to lose the original velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic VACFs show oscillations, but not the decay to 0 present in the simulated functions. This is due to the fact that harmonic approximation is only valid for atoms in vacuum or very close to the bottom of the Lennard_Jones well and does not take into account the inherent anharmonicity of the system or the possibility of collisions, meaning that the original velocity remains.&lt;br /&gt;
&lt;br /&gt;
[[File:Diffusion_vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 16.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from VACF graphs by trapezoidal method.&lt;br /&gt;
&lt;br /&gt;
From Figure 16 it can be seen that the diffusion coefficients vary widely between the independent simulation and the given data for a million atoms. For solids the trapezoidal method proved especially difficult, as the diffusion coefficient is close to 0 and it does not offer that level of precision. Both precision and accuracy are issues when using the trapezoidal method on VACF graphs, however, when compared to the values obtained by using the gradient (Figure 14), the value for all three easily matched to the same order of magnitude and even better (0.088 obtained for both liquids simulated with 1,000,000 atoms). Therefore it can be concluded the using the trapezoidal method provides a good estimate of what the diffusion coefficient might be.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Again, there is no vibrational or rotational energy in these simulations.  Can you be more specific about what the oscillations in the solid and liquid VACFs represent physically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations can be used to obtain a large volume of quality data that would otherwise be less accessible due to how even simple models can provide relatively accurate data. They can be used as a tool to investigate new systems with desired properties and supplement purely experimental data collection.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=594713</id>
		<title>Talk:Mod:gogle14</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=594713"/>
		<updated>2017-03-06T05:50:13Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Introduction to molecular dynamics simulations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of velocity-Verlet integration method&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Verlet algorithm can be used to estimate positions, velocities and momenta of particles without the need of continuous integration. Instead, it uses the knowledge of those values at previous points and Taylor expansion to find all of these values at set intervals (timesteps). Below is a comparison of the function &amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;A=1, \omega =1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi =0&amp;lt;/math&amp;gt;, therefore the function is &amp;lt;math&amp;gt;x(t)=\cos t&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_analytical_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 1.&amp;lt;/b&amp;gt; Comparison of veloity-Verlet and analytical solution of the function.&lt;br /&gt;
&lt;br /&gt;
As can be seen from Figure 1, the results generated by Verlet algorithm match the analytical values closely, indicating how powerful this approximation is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Still, there is some discrepancy present, as indicated in Figure 2 below:&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_error_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 2.&amp;lt;/b&amp;gt; Error analysis for the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
It can be seen that the error shows an oscillating behaviour (Figure 2), with the local maximum of the error growing consistently over time. This is due to the fact that the Taylor series converge to the real value, but not all terms were taken into account; the first maximum occurs where the fourth term (error term) is the largest. As previous values are used to calculate those at the next timestep, the error is cumulative and therefore increases over time, as predicted by the curve in the graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_energy_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 3.&amp;lt;/b&amp;gt; Total energy as a function of time for velocity-Verlet method.&lt;br /&gt;
&lt;br /&gt;
Another way of evaluating the usefulness of this algorithm is by seeing how well the predicted values match known values. As an isolated system is modelled, the total energy in the system should remain constant. However, Figure 3 shows that this is not the case and there are small (0.25%) fluctuations from the real value when the timestep of 0.1 is used. This shows that the system, though faithful, is still a simplification of reality, furthermore, it can tolerate even a larger timestep and thus fewer calculations, as 1% error is exceeded only when the timestep is increased to 0.2. This could save computational resources, but it also indicates the balance between the choice of timestep and the correspondence of the model to reality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Evaluation of the system used&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=4\epsilon \bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;, multiply by &amp;lt;math&amp;gt;\frac {r_0^6}{\sigma ^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\frac{\sigma^{6}}{r_0^{6}}-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}}=1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0^{6}=\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;or&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=-\sigma &amp;lt;/math&amp;gt; (root invalid, as separation has to &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
This is the separation at which potential energy is 0; the force at this separation is as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F=-\frac{d \phi (r)}{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-\frac {4\epsilon \Big( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}} \Big) }{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-4 \epsilon \bigg( -12 \frac {\sigma ^{12}}{r_0^{13}} +6 \frac{\sigma ^6}{r_0^7} \bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=48 \epsilon \frac {\sigma ^{12}}{r_0^{13}} -24 \epsilon \frac {\sigma ^6}{r_0^7}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know that &amp;lt;math&amp;gt;r_0= \sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)= \frac {48 \epsilon }{\sigma }- \frac {24 \epsilon }{\sigma }= \frac {24 \epsilon}{\sigma }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A system is said to be an equilibrium when there is no net force acting on it, i.e., the force is 0. By substituting minimum potential energy expression from above into the minimum force expression, the following formula is obtained:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F_{eq}=48 \epsilon \frac {\sigma ^{12}}{r_{eq}^{13}} -24 \epsilon \frac {\sigma ^6}{r_{eq}^7}=0&lt;br /&gt;
&amp;lt;/math&amp;gt;, divide by &amp;lt;math&amp;gt;24 \epsilon \frac {\sigma ^6}{r_{eq}^7} &amp;lt;/math&amp;gt; and rearrange:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}^6=2\sigma ^6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=+\sqrt[6]{2} \sigma \approx 1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=-\sqrt[6]{2} \sigma \approx -1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt; (root invalid, separation has to be &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
The depth of well characterises how stable the system is. For the equilibrium distance it can be found by substituting the equilibrium &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; value into the Lennard-Jones interaction equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r_{eq})=4 \epsilon \bigg( \frac{\sigma ^{12}}{(\sqrt[6]{2}\sigma)^{12}}-\frac{\sigma ^{6}}{(\sqrt[6]{2}\sigma)^{6}} \bigg)=4 \epsilon \Big( \frac{1}{4} - \frac{1}{2} \Big)=4 \epsilon \Big( - \frac{1}{4} \Big)=-\epsilon&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To evaluate the integral of the potential energy of the Lennard-Jones potential, let us set the changing lower bound to a value n, which can later be substituted for the necessary value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} \phi (r) dr=\int_{n}^{\infty} 4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg) dr&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon =\sigma =1&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} 4 \bigg( \frac{1}{r^{12}}-\frac{1}{r^{6}}\bigg) dr=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
4\bigg[ \frac {1}{5r^5}- \frac {1}{11r^{11}} \bigg]_n^{\infty}=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( [0]- \bigg( \frac{1}{5n^5} -\frac {1}{11n^{11}} \bigg) \bigg)=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( \frac {1}{11n^{11}}-\frac {1}{5n^5} \bigg) \approx -\frac {4}{5n^5}  &lt;br /&gt;
&amp;lt;/math&amp;gt;, as first term becomes negligible&lt;br /&gt;
&lt;br /&gt;
Let us substitute in the lower bound values (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is still 1):&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2.5 \sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=3\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to understand the scale of the system, let us compare the number of water particles in 1 mL of water to the volume of water that could be simulated. The number of water particles in 1 mL of water under standard conditions can be determined like this&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=\rho \times V=0.9982 \times 1=0.9982 (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{m}{N}=\frac{0.9982}{18.02}=5.539 \times 10^{-2}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N=n \times N_A=5.539 \times 10^{-2} \times 6.023 \times 10^{23}=3.336 \times 10^{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Meanwhile, 10000 molecules of water occupy this volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{N}{N_A}=\frac{10000}{6.023 \times 10^{23}}=1.660 \times 10^{-20}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=n \times M=18.02 \times 1.660 \times 10^{-20}=2.989 \times 10^{-19} (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=m \times \rho=2.989 \times 10^{-19} \times 0.9982=2.983 \times 10^{-19} (mL)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From these results it can be seen that the volumes simulated are absolutely minuscule: 18 orders of magnitude less than a single mL of water. However, even such small amounts are enough to provide us with values applicable to the macroscopic world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system also uses boundary conditions in order to ensure that the simulated environment is close to reality while also being easy to simulate&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
(0.5, 0.5, 0.5)+&lt;br /&gt;
(0.7, 0.6, 0.2)=&lt;br /&gt;
(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;, which is &lt;br /&gt;
&amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
after applying boundary conditions according to which each atom regenerates at the opposite into the cube each time it crosses its boundaries; no coordinate can exceed 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These simulations also make use of reduced units. It is done purely out of convenience so that the output and input could be as close to easily operable numbers while also having a physical meaning. For example, conversion from reduced to real units for Argon can be achieved as follows:&lt;br /&gt;
&lt;br /&gt;
1)Lennard-Jones cutoff distance of 3.2 units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r*\sigma=3.2 \times 3.4\times 10^{-10}=1.09 \times 10^{-9} (m)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)Well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_{well}=-\epsilon =120\times k_b \times N_A=120\times R=120 \times 8.31=998 (J\ \ mol^{-1})=0.998 (kJ\ \ mol^{-1})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)Temperature of 1.5 reduced units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac {\epsilon T*}{k_B}=1.5 \times 120=180 (K)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Equilibriation&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A randomly generated grouping of atoms can (and, with a large number of generated atoms, likely will) occupy thermodynamically unfeasible positions, for example, they might have overlapping van der Waals radii if generated in close proximity, which would give the atoms a larger potential energy and see them repel strongly (large kinetic energy) once the simulation is started. In normal situations the kinetic temperatures would be described by the Maxwell-Boltzmann distribution, but in the artificially created system it therefore might not be the case. In reality, all atoms occupy space and have velocities and momenta starting from a realistic previous thermodynamic state; for this reason it is better to simulate the melting of a crystal, where the initial positions can be simulated to match reality closely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsion forces in the initial system configuration can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density used in this simulation is number density: the number of atoms per unit volume. Let us consider a cubic unit cell, where all cell parameters are equal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho _n=\frac {N}{V}=\frac {N}{a^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number density of 0.8 gives the following cell parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{N}{\rho _n}}=\sqrt[3]{\frac{1}{0.8}}=1.07722&amp;lt;/math&amp;gt;, which matches the values given by the program&lt;br /&gt;
&lt;br /&gt;
This formula also allows to predict the side length of an fcc cell with the number density of 1.2; an fcc cell contains 4 atoms: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{4}{1.2}}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of atoms generated is dependent on the size of the box as well as the type of lattice used. For our initial box of a size of 10×10×10, 1000 unit cells were be generated. If fcc unit cells were to be generated instead, we would create 4000 atoms, as each fcc cell has 4 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
In order to run the simulation, knowledge of the code used is important. These three lines set the type of interactions the atoms will have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line sets the mass of each atom type. In this case, all atoms are type 1 and therefore mass is set to be 1.0 for all atoms&lt;br /&gt;
&lt;br /&gt;
The second line sets the type of force-field interaction and the cut-off distance after which there is considered to be no interaction. In this case, each atom pair interacts according to Lennard-Jones potential and the atoms are considered as non-interacting if the reduced distance is 3 or larger.&lt;br /&gt;
&lt;br /&gt;
The third line sets the strength of interaction between an atom pair. In this case, the two placeholder asterisks signify that any atom with any other atom interacts with a force-field coefficient of 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why is a cutoff used?  What are the forcefield coefficients considering that we&#039;re using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Considering that for each atom both a position and a velocity are set, we can conclude that the aforementioned velocity-Verlet integration algorithm will be used. In this case, the positions are set as crystal lattice points and the velocities are randomly assigned to obey the Maxwell-Boltzmann distribution, which is a feasible thermodynamic starting point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the length of equilibriation for the system can be estimated, computations can be run to cover that particular amount of time (100 units in the given case). Defining the timestep and letting the number of steps run be defined by the number of timesteps used can achieves a situation where only changing the timestep still lets the simulation run for the same amount of time, therefore making it simpler. Conversly, the other code means that each time a timestep is defined, the number of runs would also have to be entered manually in order to reach the same length of simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables makes it easy to change the value of certain parameters in the simulation, with all commands dependent on that parameter updating automatically.  Make it clear which task you are answering.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Evst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 4.&amp;lt;/b&amp;gt; Equilibriation of energy over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Tvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 5.&amp;lt;/b&amp;gt; Equilibriation of temperature over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_pvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 6.&amp;lt;/b&amp;gt; Equilibriation of pressure over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
From Figures 3, 4 and 5 it can be seen that all the calculated parameters reach an equilibrium quickly for the timestep of 0.001, which indicates that it is a particularly precise timestep to use.&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_Evst_all.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 7.&amp;lt;/b&amp;gt; Comparison of equilibriation of energy over time between different timesteps&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_table_eq_timesteps.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 8&amp;lt;/b&amp;gt; Average energy for each equilibriated timestep.&lt;br /&gt;
&lt;br /&gt;
In Figure 7 it is visible that all timesteps equal to and lower than 0.01 reach an equilibrium, meaning that they all can be used for simulations to varying degrees of success. The 0.015 timestep fails to reach an equilibrium at all and also provides a visibly different energy than the others, indicating that it cannot be used to simulate the liquids.&lt;br /&gt;
&lt;br /&gt;
From the remaining timestep values the average energies were extracted (Figure 8); it becomes evident that the difference between the 0.001 and 0.0025 timesteps is insignificant, while those for the higher timesteps are further from physical reality. Given the closeness of their results, 0.0025 timestep is a better choice than 0.001, as the same number of steps can cover 2.5 more time with a fixed number of steps simulated. Though not relevant to this particular simulation, this can become useful in situations when the system takes longer to reach an equilibrium, or to save computational resources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, average energy shouldn&#039;t depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Simulations under specific conditions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Setting up the system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We know that:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B T&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also at the end of each time step each velocity is multiplied by &amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt; to give the desired temperature &amp;lt;math&amp;gt;\mathfrak{T} &amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum _i m_i (\gamma v_i)^2=\frac{3}{2}Nk_B\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\gamma ^2}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B\mathfrak{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After dividing by the original equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma ^2=\frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the script there is a line saying:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables starting with v_ show the output values that will be generated at each set interval. The interval at which the output is given is set by the fist number following the ave/time command; in this case it is 100, meaning that the output is generated every 100 timesteps. The second number sets the number of times the input values will be used, in this case, it is 1000 times. The last number (100000) sets the frequency at which the average output values are generated. As the next line of the script is as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the average value generated will also be the overall average value, generated from 100000/100=1000 values.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This is a bit unclear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to compare the simulated values to the ideal gas equation, first we must rewrite it in reduced units. The ideal gas law states that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;pV=Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As&lt;br /&gt;
&amp;lt;math&amp;gt;p=p^* \frac{\epsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\frac{\epsilon}{k_B}&amp;lt;/math&amp;gt; and &lt;br /&gt;
&amp;lt;math&amp;gt;\rho =\frac {\rho ^*}{\sigma ^3}&amp;lt;/math&amp;gt;, we can substitute these values into the ideal gas equation, which gives the ideal gas equation in reduced units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=\frac{p^*}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are expressing density as a function of temperature, it is visible that reduced density is inversely proportional to reduced temperature with the gradient of reduced pressure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=p^*\times \frac{1}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of densities&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:density_vs_temp.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 9.&amp;lt;/b&amp;gt; Calculated densities at different temperatures and pressures.&lt;br /&gt;
&lt;br /&gt;
Figure 9 shows that at constant pressure, density is decreasing with temperature. Furthermore, increased pressure increases the density at the same temperature; both of these facts match the physical reality and therefore the simulation has been at least somewhat successful. However, the theoretical density values for an ideal gas are dramatically higher for the same temperature. It is due to the fact that the ideal gas equation completely ignores any intermolecular interactions, including the repulsive ones that dominate at this pressure and cause the atoms to increase their internuclear distances. As the system is warmed up, the discrepancy between both the ideal and non-ideal gas start to disappear, as at higher temperatures densities decrease, the space between atoms increase and real gases start to behave similar to ideal gases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Heat capacity&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was the code used to run the heat capacity experiments. New output variables were defined and mentions of pressure were deleted, as it is not necessary to be measured. This code was used to run the simulation at density of 0.2 and temperature of 2.2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2 &lt;br /&gt;
lattice sc ${density}&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.2&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;
reset_timestep 0&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temper equal temp&lt;br /&gt;
variable temper2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable energytotal equal etotal&lt;br /&gt;
variable energytotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temper v_dens2 v_temper2 v_energytotal v_energytotal2&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 heatcap equal ${n}*${dens}*(f_aves[6]-f_aves[5]*f_aves[5])/(f_aves[2]*f_aves[2])&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;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of the file can be viewed below:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat_cap_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 10.&amp;lt;/b&amp;gt; Heat capacity as a function of temperature at p=0.2 and p=0.8&lt;br /&gt;
&lt;br /&gt;
Both pressures show a reduction in heat capacity with increasing temperature (Figure 10). As higher heat capacity correlates with a higher number of rotational, vibrational and other thermally reachable states and more accessible degrees of freedom, it is logical that with increasing temperature the number of states accessible with further increase would drop and therefore the heat capacity would decrease (i.e., more heat energy is converted to kinetic energy in hot molecules than cold molecules). The curve at 0.8 units reduced pressure has a peculiar hump around 2.3-2.4 temperature, indicating that in those particular circumstances there is a higher density of states for some reason that would need further investigation.&lt;br /&gt;
&lt;br /&gt;
It can also be seen that larger pressure applied to a system at a certain temperature would increase the heat capacity over volume. This is due to the fact that now a unit volume contains more molecules and therefore has more accessible states. In other words, the increased pressure increases density and thus the density of states as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There is no vibrational or rotational energy in your simulations as you are just simulating spherical particles.  Particle density is not necessarily related to density of energy states.  A higher pressure and so higher density means more particles per unit volume and so more energy is required per unit volume to raise the temperature.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Radial distribution function&amp;lt;/h2&amp;gt;&lt;br /&gt;
[[File:RDF_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 11.&amp;lt;/b&amp;gt; Radial distribution function for a solid, liquid and vapour&lt;br /&gt;
&lt;br /&gt;
Simulations in Figure 11 run at density of 1.15 and temperatures of 0.07, 0.7 and 1.2 to obtain vapour, liquid and solid respectively. The radial distribution functions (RDF) of each phase show some similar features with the the values of 0 up to radii values of around 0.8, followed by one or more peaks and then largely tending to 1. The radial distribution function illustrates the probability of finding at atom at a certain distance from the origin atom. As all atoms repel over short distances, spectra for all three phases show that there there are no other atoms in direct vicinity of the origin atom. Directly outside of this sphere the probability of finding an atom is relatively large, corresponding to the attractive and repulsive parts of Lennard-Jones potential respectively. The function then tends to normalise to 1.&lt;br /&gt;
&lt;br /&gt;
However, there are marked differences in the number of peaks close to atoms in each phase. Gases only get one initial peak, as gas particles interact very weakly and have larger distances between them, therefore they do not have any long-range structure. Liquids show three discernible peaks due to the fact that there exists a short-range structure, as liquid particles are in closer proximity due to existing attractive forces between them. After that, the function tends to 1, indicating a lack of long-range structure. The solids have a large number of peaks, as they exist in crystalline forms and therefore have a large amount of both short-range and long-range structure. Crystals are periodic, therefore as the radius grows, the imaginary sphere crosses either empty space or several atoms in all directions, giving rise to many discernible peaks. Even though the RDF value tends to 1 over time, it can never reach it and shows oscillatory behaviour instead because of the high order of long-range structure present in crystals.&lt;br /&gt;
 &lt;br /&gt;
[[File:gatis_lattice_illustration.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 12.&amp;lt;/b&amp;gt; Illustration of the lattice structure.&lt;br /&gt;
&lt;br /&gt;
Illustrated above is the connectivity in the fcc lattice; the red atom is the atom of origin. It is visible that the closest atoms are located on the faces of the cube which intersect at the origin point. The distance a is half of a diagonal of the face of the cube, i.e., it is equal to &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a_l&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;a_l&amp;lt;/math&amp;gt; is the lattice parameter. The next closest atoms is the corner of the cube, and distance b is therefore equal to the lattice paramter. Third closest atoms can be found on the centres of the faces of the cube that do not contain the origin point. The distance c can be calculated as the hypotenuse of the right triangle one side of which is distance a and the other one is one side of distance b, it is therefore &amp;lt;math&amp;gt;c=\sqrt{1^2+\bigg(\frac{\sqrt{2}}{2}\bigg)^2}a_l=\sqrt{\frac{3}{2}}a_l&amp;lt;/math&amp;gt;. The positions of the first three peaks on the RDF rougly correspond to the coefficients of the theoretical distance values by a factor of 1.5, as they are at radii of 1.025, 1.475 and 1.925 respectively.&lt;br /&gt;
&lt;br /&gt;
The area under each peak is proportional to the number of atoms it corresponds to. As the origin atom is in the corner of this cube, it is also simulatanously part of &amp;lt;math&amp;gt;2^3=8&amp;lt;/math&amp;gt; cubes, and so are the atoms close to it. &lt;br /&gt;
There are 3 blue atoms in each of the 8 cubes, but each blue atom is on the face of the cube and is therefore shared between two cubes, so there are &amp;lt;math&amp;gt;\frac{3\times 8}{2}=12&amp;lt;/math&amp;gt; blue atoms coordinated with the origin atom.&lt;br /&gt;
&lt;br /&gt;
There are 3 green atoms in each of the 8 cubes in the coordination sphere, however, as each green atom is on the corner of the adjacent cubes, each of them is shared between 4 cubes in the coordination sphere, therefore &amp;lt;math&amp;gt;\frac{3\times 8}{4}=6&amp;lt;/math&amp;gt; green atoms coordinate with the origin.&lt;br /&gt;
&lt;br /&gt;
None of the orange atoms are part of another cube in the coordination sphere, therefore there are &amp;lt;math&amp;gt;3\times 8=24&amp;lt;/math&amp;gt; orange atoms within distance c of the origin atom.&lt;br /&gt;
&lt;br /&gt;
From the obtained values we can see that the intensity of each peak also mathces what is expected from theory, therefore it can be concluded that the RDF provides useful information about both long-range and short-range structure of solids.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to express the distances to the first 3 peaks in terms of the lattice parameter - calculate an average lattice parameter from this that you can compare with the value of the initial lattice. The expected number of atoms contributing to each peak are well worked out, but did you check these values with the integral of the RDF, show this graph.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Dynamical properties and diffusion coefficient &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Mean square displacement&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:MSD_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 13.&amp;lt;/b&amp;gt; Mean square displacement for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
In Figure 13, the calculated values are represented with a warm (red-orange-gold) colour scheme, while the given values from 1000000 atoms are shown with a cool (blue-turquoise-green) colour scheme.&lt;br /&gt;
&lt;br /&gt;
The simulated values completely correspond to what is expected from theory: in solid phase the atoms remain almost completely static due to their being in a crystal structure. In both liquid phase and vapour phase the mean square displacement (MSD) increases with time, tending towards a straight line behaviour (pure diffusive behaviour). As liquids have more attractive forces than gases and they are denser, clearly the MSD should be much lower in them than vapour phase; indeed, this behaviour is corroborated by the calculated values.&lt;br /&gt;
&lt;br /&gt;
The provided results of a simulation of 1000000 atoms shows a very similar qualitative behaviour, especially in the solid phase. The provided simulation shows a somewhat lower rate of increase in MSD than the independently run calculation with the opposite being true for the vapour phases. However, it is difficult to speculate about the reasons why this could be the case due to the uncertainty about what conditions were used in the simulations provided.&lt;br /&gt;
&lt;br /&gt;
As it is known that &amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta \langle r^2 (t)\rangle}{\delta t}&amp;lt;/math&amp;gt;, it can also be seen that the diffusion coefficient is &amp;lt;math&amp;gt;\frac{1}{6}&amp;lt;/math&amp;gt; of the gradient at the linear component of the curve. As the graph shows the gradient in the units of the timestep, each gradient has to be divided by the length of the timestep (0.002). The obtained diffusion coefficients are as shown in Figure 14:&lt;br /&gt;
&lt;br /&gt;
[[File:Dif_coef_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 14.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from the gradients of MSD functions&lt;br /&gt;
&lt;br /&gt;
As can be seen, the diffusion coefficient is negligible in solids and about an order of magnitude larger in gases than it is in liquids. A relatively good agreement between the independently simulated values and the values obtained from the provided data can be observed. As diffusion is measured in units of distance squared over time, in this case the units change depending on what the reduced length is equal to as well as the length of one time unit used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the gas MSD start off as a curved line, what does this represent?  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Velocity autocorrection function&amp;lt;/h3&amp;gt;&lt;br /&gt;
The velocity autocorrection function (VACF) for a harmonic oscillator can be solved as follows:&lt;br /&gt;
It is known that&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{v(t)v(t+\tau ) dt}}{\int_{-\infty }^{\infty}{v^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also known that harmonic oscillator is described by&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi )&amp;lt;/math&amp;gt;, which differentiates into &amp;lt;math&amp;gt;v(t)=-A\omega \sin (\omega t+\phi )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us substitute it into the autocorrection formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{A\omega \sin (\omega t+\phi )A\omega \sin (\omega (t+\tau) +\phi ) dt}}{\int_{-\infty }^{\infty}{(A\omega \sin (\omega t+\phi ))^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega ^2&amp;lt;/math&amp;gt; cancel out (constants); &amp;lt;math&amp;gt;\sin (\omega (t+\tau )+\phi )&amp;lt;/math&amp;gt; expanded as per a basic trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{\sin (\omega t+\phi )(\sin (\omega t +\phi )\cos (\omega \tau)+(\sin (\omega \tau)\cos (\omega t+\phi )) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
separate and bring out constants:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\cos (\omega \tau)\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}+\frac{\sin (\omega \tau)\int_{-\infty }^{\infty}{\sin (\omega t+\phi )\cos (\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the left hand side summand &amp;lt;math&amp;gt;\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}&amp;lt;/math&amp;gt; cancel out; in the right hand side summand the odd function&lt;br /&gt;
&amp;lt;math&amp;gt;\sin (\omega t+\phi )\cos (\omega t+\phi )&amp;lt;/math&amp;gt; is integrated over the real number axis, giving 0 as the value of the second summand. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;c(\tau )=\cos (\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, clear derivation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 15.&amp;lt;/b&amp;gt; Velocity autocorrection functions for a liquid, a solid and a harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
As is seen in the Figure 15, both for the liquid and the gas VACF values start high and then with different degrees of oscillatory behaviour approach 0, which means complete lack of correlation. It makes physical sense, as in the beginning the original velocity is the only velocity, but its effect starts to decrease as kinetic energy either is lost to rotational/vibrational energy or is affected by collisions with other particles. Subsequently, the harmonic oscillator correctly predicts oscillations and both liquids and gases tend to change their velocity over time until the original velocity has very little impact on the final velocity. The difference lies in the fact that for solids the oscillation phase lasts much longer, while liquids tend to decorrelate faster. This is due to liquids being in a less structured environment with a larger risk of collision, while for solids in crystalline environments collisions are more limited and they have less kinetic energy, therefore it takes longer to lose the original velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic VACFs show oscillations, but not the decay to 0 present in the simulated functions. This is due to the fact that harmonic approximation is only valid for atoms in vacuum or very close to the bottom of the Lennard_Jones well and does not take into account the inherent anharmonicity of the system or the possibility of collisions, meaning that the original velocity remains.&lt;br /&gt;
&lt;br /&gt;
[[File:Diffusion_vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 16.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from VACF graphs by trapezoidal method.&lt;br /&gt;
&lt;br /&gt;
From Figure 16 it can be seen that the diffusion coefficients vary widely between the independent simulation and the given data for a million atoms. For solids the trapezoidal method proved especially difficult, as the diffusion coefficient is close to 0 and it does not offer that level of precision. Both precision and accuracy are issues when using the trapezoidal method on VACF graphs, however, when compared to the values obtained by using the gradient (Figure 14), the value for all three easily matched to the same order of magnitude and even better (0.088 obtained for both liquids simulated with 1,000,000 atoms). Therefore it can be concluded the using the trapezoidal method provides a good estimate of what the diffusion coefficient might be.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Again, there is no vibrational or rotational energy in these simulations.  Can you be more specific about what the oscillations in the solid and liquid VACFs represent physically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations can be used to obtain a large volume of quality data that would otherwise be less accessible due to how even simple models can provide relatively accurate data. They can be used as a tool to investigate new systems with desired properties and supplement purely experimental data collection.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Az1114&amp;diff=592075</id>
		<title>Talk:Mod:Az1114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Az1114&amp;diff=592075"/>
		<updated>2017-03-02T02:09:06Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but some details missing especially in the last few sections.  Try to add a bit more to the explanations of your results and make sure that you understand the background theory behind the tasks and use this in your explanations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity-Verlot Algorithm versus the Harmonic Oscillator===&lt;br /&gt;
&lt;br /&gt;
Below in the two figures are the graphs for displacement and energy versus time of a classical harmonic oscillator compared to the values given by the velocity-Verlet algorithm. Both graphs are set at a timestep of 0.1, and it can be seen that for the displacement there is no significant deviation between the displacement of the two different methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Displacementaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energyintroaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The following graph is the error of the velocity-Verlot alorithm, or more specifically the absolute difference between the two methods versus time. Note that the value of error oscillates with time between 0 and a maximum, with the maximum generally increasing. The error maximum is found when displacement is zero, thus when at a velocity maximum.&lt;br /&gt;
&lt;br /&gt;
[[File:Erroraz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A range of timesteps were used to find what is optimal, from 0.001 to 0.015. It was found that with higher timestep the error with displacement (and therefore energy) increased too. The total error of 1% was not crossed with the timesteps used, but it can be extrapolated to be around a timestep of 0.2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, why does the error oscillate and the maximum error increase over time?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!Error in Displacement (absolute values)&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.000006&lt;br /&gt;
|-&lt;br /&gt;
|0.05&lt;br /&gt;
|0.0005&lt;br /&gt;
|-&lt;br /&gt;
|0.075&lt;br /&gt;
|0.002&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|0.15&lt;br /&gt;
|0.08&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The below equation calculates the Leonard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; - the separation at which the potential is 0 - is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in the value &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the distance that represents the minimum in potential energy. It can therefore be found by equating the force to zero &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &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&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, except the force should be positive.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, the number of molecules in 1 mL of water is given by:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Conversely, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the simulation to be completed in a reasonable amount of time, the atoms in the simulation are placed in a box with boundary conditions. The box is repeated in all directions, similar to a unit cell in a lattice. If an atom moves outside of the box, another will enter the box from the opposite side, maintaining the same number of atoms in the box.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cube of dimensions &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, assuming the periodic boundary conditions have been upheld.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
When initiating the simulation, the atoms are given regular spacing intervals like that found in a square lattice. They are not given random positions, as if by chance two atoms occupy the same space, the program will encounter error.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice (thus having 1 lattice point per unit cell) with number density 0.8:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore the spacing between atoms is 1.0772 unit lengths (in reduced units).&lt;br /&gt;
&lt;br /&gt;
Giving the same treatment to a face-centred cubic lattice (4 lattice points/unit cell) with a number density of 1.2 will have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\ \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This should be (4/1.2)^1/3 = 1.49.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
The input script contained a the following commands:&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command takes two arguments, setting the mass of type 1 atoms as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt; (still in reduced units).&lt;br /&gt;
The second line defines the type of interaction between the atoms (above set to &#039;lj&#039; for Leonard-Jones); with a cutoff distance of &amp;lt;math?3.0&amp;lt;/math&amp;gt; units.&lt;br /&gt;
The third line defines the values for the Leonard-Jones interactions, the former &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt; setting the well depth &amp;lt;math&amp;gt;epsilon&amp;lt;/math&amp;gt; and the latter sets &amp;lt;math&amp;gt;sigma&amp;lt;/math&amp;gt;. The two asterisks tell the program that this applies to all atoms in the system.&lt;br /&gt;
&lt;br /&gt;
Once the properties of the particles are set, the initial positions and velocities are defined. As we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; &amp;amp; &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, the Velocity-Verlet integration half-step algorithm can be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why is a cutoff used?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We created and set a variable named &#039;timestep&#039; to 0.001, and used that value to calculate how many runs (${n_steps}) to carry out. This is superior to writing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This allows us only to change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} each time the timestep is altered, especially in cases such as this computational experiment where the timestep can be changed multiple times.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
The following 3 graphs check whether the system&#039;s total energy, temperature, and pressure (respectively), equilibrate over time during the 0.001 time-step simulation.&lt;br /&gt;
y-axis values are in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Total Energyaz.png|thumb|600px|none]] [[File:Temperatureaz.png|thumb|600px|none]] [[File:Pressureaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The following figure shows how total energy varies with time for many different timesteps. Note how at a large timestep of 0.15, the temperature actually diverges! Thus very high timesteps should not be used do to inaccuracies that can accrue.&lt;br /&gt;
&lt;br /&gt;
[[File:Different Timesteps.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What about the other timesteps, which timestep did you choose and why?  What is wrong with the 0.01 and 0.0075 - should the average total energy depend on the timestep?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
A timestep of 0.0025 was chosen as it is a good comprimise between accuracy of simulation and the length at which the simulation can run.&lt;br /&gt;
The following Temperatures are pressures were chosen as were about the equilibration values:&lt;br /&gt;
T: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
P: 2.45, 2.65&lt;br /&gt;
&lt;br /&gt;
In the simulation, the temperature was controlled deducing the (fluctuaing) instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; using the following equations:&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; that controls the particles&#039; velocities:&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}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus we can solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but you have used epsilon rather than curly T in the final expression.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Explaining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
In order to calculate the average values for our simulation, the following parameters are set in the input script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that final averages are calculated only on timesteps that are multiples of Nevery, Nrepeat times; and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
The following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Means that the results will be  sampled every 100 timesteps for 1000 times (100, 200, 300, etc.). The averages are then calculated 100,000 timesteps, however as our simulation runs for the same amount of time, only a single average is produced with these parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this simulation was 0.0025.&lt;br /&gt;
&lt;br /&gt;
===Equations of State===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NpTaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The above graph is a plot of the density versus temperature of the system for a liquid at two different pressures. There are plots for the values calculated from the simulation and from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
There is a large difference between the simulated and ideal values, to an extent that they are much larger than the standard error of the simulated values, meaning the y-axis error bars are not visible. However they both follow a trend of the density decreasing with temperature, which follows the theory of thermal expansion.&lt;br /&gt;
&lt;br /&gt;
A reason for the discrepancy will be due to the nature of the ideal gas law ignoring all interactions between particles, whereas in the simulation there is some Leonard Jones force, which when acting repulsively can push atoms further apart, resulting in a lower simulated density than in the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
Also note that the interactions in liquids are much greater than the interactions in gases, and so to use the ideal gas law for a liquid can quickly become a very crude approximation.&lt;br /&gt;
It can also be seen that as the temperature increases, the discrepancy between the ideal and simulated densities becomes smaller.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How does the discrepancy between the simulation and ideal gas results change with pressure?  You could have chosen a larger difference in pressure to see the trend more clearly.  Joining the ideal gas data points with straight lines is misleading as you know that the ideal gas law doesn&#039;t follow a straight line (density = 1/T).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations==&lt;br /&gt;
The heat capacity to volume ratio versus temperature is plotted below. Theoretically, heat capacity will decrease with increasing temperature and increase with respect to increasing density, as there will be more molecules per unit volume that needs to increase in energy.&lt;br /&gt;
&lt;br /&gt;
[[File:NVTaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you expand on this, why do you expect these trends theoretically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radial Distribution Functions==&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions of a Leonard-Jones system in the solid, liquid and gas phase are distinctly different. This is due to the degrees of freedom that exist in each particular phase. In the solid phase, all the atoms are locked into a lattice structure, having only vibrational motion, with both long-range and short range order.&lt;br /&gt;
&lt;br /&gt;
Liquids have more degrees of freedom, with no long-range order. They also exhibit rotational and to some extent translational motion. Then gases have the most freedom of all states, having a much larger translational motion.&lt;br /&gt;
&lt;br /&gt;
From the RDF graph it can be seen that the solid function has a very distinct function with peaks and troughs. This is due to its atoms being fixed into a lattice with long-range order. For the liquid, there is a few peaks and troughs, representing the short range order of particles immediately surrounding the central particle, then averaging out to 1 - the system density. For the gaseous phase, the curve very quickly tends to the average value of 1, as there is no short- or long-range order in this phase.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How can rotational motion alter the RDF considering that the simulations are of spherical particles?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:RDFaz.jpg]]&lt;br /&gt;
&lt;br /&gt;
From the curve for the solid the first 3 peaks at increasing distance can be attributed to the different lattice points in the fcc lattice about the original atom. For an atom on the corner of a cube, the 3 distances represent an atom at an adjacent vertex, an adjacent face, and an opposing face. These occur at a reduced distance of 1.06, 1.48 and 1.83 respectively. These agree with the distances noted on the graph. The coordination number can be deduced from the running integral of the curve and for the 3 peaks are given by 11, 6 &amp;amp; 24 respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the running integral graph and how you calculated at what distance the first 3 peaks should appear at.  Can you calculate the lattice parameter from the RDF?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &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;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! State !! From MSD (thousand atoms) !! From MSD (million) !! From VCAF (thousand atoms) !! From VCAF (million)&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;8.96 \times 10^{-6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.5 \times 10^{-6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.085&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.089&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.098&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.090&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;2.38&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.35&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite precise. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where the gas have the highest diffusion coefficient (they are able to diffuse much faster) than the liquid, and the diffusion coefficient of the solid is close to 0.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&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;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD1az.jpg|thumb|600px|none]][[File:MSD2az.jpgthumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs it can be concluded that the final 1000 timesteps follow linearity with which to apply the equations, and thus the diffusion coefficients can be calculated from the last timesteps.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit on the graphs.  Why does the gas MSD begin as a curve (ballistic motion).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
Starting from a 1D Harmonic Oscillator:&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;
Differentiating gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\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) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, using the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\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^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant, thus &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is odd.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&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;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, clear derivation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACFaz.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
From the graph note that the liquid VACF tends quickly to zero, and the solid has small fluctuations. The difference arises as the in the liquid phase the particles have more translational freedom and can collide, exchanging energy between particles. Solid phase atoms retain a relatively static position around their equilibrium position. Also the solid rate will decay slower than in liquids.&lt;br /&gt;
&lt;br /&gt;
For the harmonic oscillator, the VACF will not decay to zero as the there are atoms exchanging with their neighbours, which do not occur in harmonic oscillation.&lt;br /&gt;
&lt;br /&gt;
[[File:runningintegralaz.png]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The running integral plot has not uploaded properly.  What does the minimum in the solid VACF represent physically?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The values for D from the VCAF model were greater in magnitude than those from the MSD calculations. The greatest source of error is most likely to be the use of the trapezium rule instead of an exact integral of each function.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Az1114&amp;diff=591818</id>
		<title>Talk:Mod:Az1114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:Az1114&amp;diff=591818"/>
		<updated>2017-03-01T10:31:05Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot; ===Velocity-Verlot Algorithm versus the Harmonic Oscillator===  Below in the two figures are the graphs for displacement and energy versus time of a classical harmonic oscill...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
===Velocity-Verlot Algorithm versus the Harmonic Oscillator===&lt;br /&gt;
&lt;br /&gt;
Below in the two figures are the graphs for displacement and energy versus time of a classical harmonic oscillator compared to the values given by the velocity-Verlet algorithm. Both graphs are set at a timestep of 0.1, and it can be seen that for the displacement there is no significant deviation between the displacement of the two different methods.&lt;br /&gt;
&lt;br /&gt;
[[File:Displacementaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energyintroaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The following graph is the error of the velocity-Verlot alorithm, or more specifically the absolute difference between the two methods versus time. Note that the value of error oscillates with time between 0 and a maximum, with the maximum generally increasing. The error maximum is found when displacement is zero, thus when at a velocity maximum.&lt;br /&gt;
&lt;br /&gt;
[[File:Erroraz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A range of timesteps were used to find what is optimal, from 0.001 to 0.015. It was found that with higher timestep the error with displacement (and therefore energy) increased too. The total error of 1% was not crossed with the timesteps used, but it can be extrapolated to be around a timestep of 0.2.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!Error in Displacement (absolute values)&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.000006&lt;br /&gt;
|-&lt;br /&gt;
|0.05&lt;br /&gt;
|0.0005&lt;br /&gt;
|-&lt;br /&gt;
|0.075&lt;br /&gt;
|0.002&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|0.15&lt;br /&gt;
|0.08&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
=== Lennard-Jones Potential ===&lt;br /&gt;
The below equation calculates the Leonard-Jones potential:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By equating this to 0, we find that the &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; - the separation at which the potential is 0 - is &amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We can then find the force at this separation by differentiating the Lennard-Jones potential with respect to r, and substituting in the value &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}=\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24 \frac{\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation (&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;) is the separation of the particles at equilibrium, and represents the distance that represents the minimum in potential energy. It can therefore be found by equating the force to zero &amp;lt;math&amp;gt;\frac{\mathrm{d}\phi}{\mathrm{d}r}&amp;lt;/math&amp;gt;, (or &amp;lt;math&amp;gt;\mathbf{F}&amp;lt;/math&amp;gt;) to 0.&lt;br /&gt;
&lt;br /&gt;
Hence,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}=-24\epsilon \left(\frac{2 \sigma^{12}}{r^{13}}-\frac{\sigma^6}{r^7}\right) 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2\sigma^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; gives us the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r_{eq})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To put this equation into perspective, let us calculate the L-J potential for some realistic cutoff values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=4 \epsilon \left(\frac{\sigma^{12}}{11r^{11}}-\frac{\sigma^6}{5r^5}\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &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&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\lim_{r\rightarrow \infty} 4 \left(\frac{1^{12}}{11r^{11}}-\frac{1^6}{5r^5}\right) - 4\left(\frac{1^{12}}{11\times 2^{11}}+\frac{1^6}{5\times 2^5}\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=0-0.024822\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Following the same calculations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0081767\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=-0.0032901\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\approx -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The calculations show that as the cutoff distance increases, the Lennard-Jones potential decreases, which agrees with the theory.&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
It is very difficult to simulate realistic volumes of liquid and in the scope of this experiment, we have simulated liquids with N (number of atoms) between 1,000 and 10,000. To demonstrate why simulating realistic volumes of liquid is difficult, the number of molecules in 1 mL of water is given by:&lt;br /&gt;
&lt;br /&gt;
(Assuming: Standard conditions; Density of water = 1.00 g/ml)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1.00 \mathrm{ml} = 1.00 \mathrm{g}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;18.02 \mathrm{g/mol} = 0.0555 \text{ mols of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.0555 \times 6.022 \times 10^{23} = 3.34 \times 10^{22} \text{ molecules of water.}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Conversely, 10,000 water molecules is only &amp;lt;math&amp;gt;2.99 \times 10^{-19} \text{ ml of water}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the simulation to be completed in a reasonable amount of time, the atoms in the simulation are placed in a box with boundary conditions. The box is repeated in all directions, similar to a unit cell in a lattice. If an atom moves outside of the box, another will enter the box from the opposite side, maintaining the same number of atoms in the box.&lt;br /&gt;
&lt;br /&gt;
For example, if an atom at position &amp;lt;math&amp;gt;(0.5, 0.5, 0.5)&amp;lt;/math&amp;gt; in a cube of dimensions &amp;lt;math&amp;gt;(0, 0, 0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1, 1, 1)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;(0.7, 0.6, 0.2)&amp;lt;/math&amp;gt;, its final position would be &amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;, assuming the periodic boundary conditions have been upheld.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
The LAMMPS calculations run in this experiment are all done in reduced units&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34 \mathrm{nm}&amp;lt;/math&amp;gt;; &amp;lt;math&amp;gt;\epsilon/k_B=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If we set the cutoff to be &amp;lt;math&amp;gt;r*=3.2,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=3.2\times0.34=1.088\mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth: &amp;lt;math&amp;gt;\epsilon=120K\times k_B \times 6.02 \times 10^{23}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon=0.998 \mathrm{kJ/mol}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and reduced temperature &amp;lt;math&amp;gt;T*=1.5&amp;lt;/math&amp;gt; would be &amp;lt;math&amp;gt;T=1.5 \times 120=180\mathrm{K}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
When initiating the simulation, the atoms are given regular spacing intervals like that found in a square lattice. They are not given random positions, as if by chance two atoms occupy the same space, the program will encounter error.&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice (thus having 1 lattice point per unit cell) with number density 0.8:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.8 \text{ points/volume}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sqrt[3]{0.8}=0.9283\text{ points/length}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0.9283^{-1}=1.0772 \text{ length/point}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore the spacing between atoms is 1.0772 unit lengths (in reduced units).&lt;br /&gt;
&lt;br /&gt;
Giving the same treatment to a face-centred cubic lattice (4 lattice points/unit cell) with a number density of 1.2 will have a spacing of &amp;lt;math&amp;gt;0.5928&amp;lt;/math&amp;gt; as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\ \sqrt[3]{4.8^{-1}}=0.5928&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition, the simple cubic lattice with a density of 0.8 would create 1,000 atoms in the given constraints of the box:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;region box block 0 10 0 10 0 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and a face centred cubic lattice with a density of 1.2 would create 4,000 atoms in the same box.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
The input script contained a the following commands:&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command takes two arguments, setting the mass of type 1 atoms as &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt; (still in reduced units).&lt;br /&gt;
The second line defines the type of interaction between the atoms (above set to &#039;lj&#039; for Leonard-Jones); with a cutoff distance of &amp;lt;math?3.0&amp;lt;/math&amp;gt; units.&lt;br /&gt;
The third line defines the values for the Leonard-Jones interactions, the former &amp;lt;math&amp;gt;1.0&amp;lt;/math&amp;gt; setting the well depth &amp;lt;math&amp;gt;epsilon&amp;lt;/math&amp;gt; and the latter sets &amp;lt;math&amp;gt;sigma&amp;lt;/math&amp;gt;. The two asterisks tell the program that this applies to all atoms in the system.&lt;br /&gt;
&lt;br /&gt;
Once the properties of the particles are set, the initial positions and velocities are defined. As we have both the &amp;lt;math&amp;gt;\mathbf{x}_i(0)&amp;lt;/math&amp;gt; &amp;amp; &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, the Velocity-Verlet integration half-step algorithm can be used.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
In the following lines from the input script:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We created and set a variable named &#039;timestep&#039; to 0.001, and used that value to calculate how many runs (${n_steps}) to carry out. This is superior to writing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This allows us only to change the value of the timestep variable to alter the number of runs, rather than having to calculate ${n_steps} each time the timestep is altered, especially in cases such as this computational experiment where the timestep can be changed multiple times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Equilibration===&lt;br /&gt;
&lt;br /&gt;
The following 3 graphs check whether the system&#039;s total energy, temperature, and pressure (respectively), equilibrate over time during the 0.001 time-step simulation.&lt;br /&gt;
y-axis values are in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Total Energyaz.png|thumb|600px|none]] [[File:Temperatureaz.png|thumb|600px|none]] [[File:Pressureaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The following figure shows how total energy varies with time for many different timesteps. Note how at a large timestep of 0.15, the temperature actually diverges! Thus very high timesteps should not be used do to inaccuracies that can accrue.&lt;br /&gt;
&lt;br /&gt;
[[File:Different Timesteps.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (NpT) ==&lt;br /&gt;
&lt;br /&gt;
=== Temperature and Pressure Control ===&lt;br /&gt;
A timestep of 0.0025 was chosen as it is a good comprimise between accuracy of simulation and the length at which the simulation can run.&lt;br /&gt;
The following Temperatures are pressures were chosen as were about the equilibration values:&lt;br /&gt;
T: 1.5, 1.6, 1.7, 1.8, 1.9&lt;br /&gt;
P: 2.45, 2.65&lt;br /&gt;
&lt;br /&gt;
In the simulation, the temperature was controlled deducing the (fluctuaing) instantaneous temperature &amp;lt;math&amp;gt;T,&amp;lt;/math&amp;gt; using the following equations:&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 \qquad\qquad\qquad(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order for &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; to reach our target temperature &amp;lt;math&amp;gt;\mathfrak{T},&amp;lt;/math&amp;gt; we introduce a constant &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; that controls the particles&#039; velocities:&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}\qquad\qquad(2)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus we can solve for &amp;lt;math&amp;gt;\gamma.&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;math&amp;gt;(2)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2\sum_i m_i v_i^2 = 3N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then substituting &amp;lt;math&amp;gt;\sum_i m_i v_i^2&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;(1)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2 3 N k_b T = 3N k_b \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\epsilon}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explaining the Input Script ===&lt;br /&gt;
&lt;br /&gt;
In order to calculate the average values for our simulation, the following parameters are set in the input script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time Nevery Nrepeat Nfreq&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means that final averages are calculated only on timesteps that are multiples of Nevery, Nrepeat times; and an average is generated every Nfreq timesteps.&lt;br /&gt;
&lt;br /&gt;
The following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Means that the results will be  sampled every 100 timesteps for 1000 times (100, 200, 300, etc.). The averages are then calculated 100,000 timesteps, however as our simulation runs for the same amount of time, only a single average is produced with these parameters.&lt;br /&gt;
&lt;br /&gt;
The timestep chosen for this simulation was 0.0025.&lt;br /&gt;
&lt;br /&gt;
===Equations of State===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:NpTaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
The above graph is a plot of the density versus temperature of the system for a liquid at two different pressures. There are plots for the values calculated from the simulation and from the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
There is a large difference between the simulated and ideal values, to an extent that they are much larger than the standard error of the simulated values, meaning the y-axis error bars are not visible. However they both follow a trend of the density decreasing with temperature, which follows the theory of thermal expansion.&lt;br /&gt;
&lt;br /&gt;
A reason for the discrepancy will be due to the nature of the ideal gas law ignoring all interactions between particles, whereas in the simulation there is some Leonard Jones force, which when acting repulsively can push atoms further apart, resulting in a lower simulated density than in the ideal gas law.&lt;br /&gt;
&lt;br /&gt;
Also note that the interactions in liquids are much greater than the interactions in gases, and so to use the ideal gas law for a liquid can quickly become a very crude approximation.&lt;br /&gt;
It can also be seen that as the temperature increases, the discrepancy between the ideal and simulated densities becomes smaller.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculations==&lt;br /&gt;
The heat capacity to volume ratio versus temperature is plotted below. Theoretically, heat capacity will decrease with increasing temperature and increase with respect to increasing density, as there will be more molecules per unit volume that needs to increase in energy.&lt;br /&gt;
&lt;br /&gt;
[[File:NVTaz.png|thumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radial Distribution Functions==&lt;br /&gt;
&lt;br /&gt;
The radial distribution functions of a Leonard-Jones system in the solid, liquid and gas phase are distinctly different. This is due to the degrees of freedom that exist in each particular phase. In the solid phase, all the atoms are locked into a lattice structure, having only vibrational motion, with both long-range and short range order.&lt;br /&gt;
&lt;br /&gt;
Liquids have more degrees of freedom, with no long-range order. They also exhibit rotational and to some extent translational motion. Then gases have the most freedom of all states, having a much larger translational motion.&lt;br /&gt;
&lt;br /&gt;
From the RDF graph it can be seen that the solid function has a very distinct function with peaks and troughs. This is due to its atoms being fixed into a lattice with long-range order. For the liquid, there is a few peaks and troughs, representing the short range order of particles immediately surrounding the central particle, then averaging out to 1 - the system density. For the gaseous phase, the curve very quickly tends to the average value of 1, as there is no short- or long-range order in this phase.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFaz.jpg]]&lt;br /&gt;
&lt;br /&gt;
From the curve for the solid the first 3 peaks at increasing distance can be attributed to the different lattice points in the fcc lattice about the original atom. For an atom on the corner of a cube, the 3 distances represent an atom at an adjacent vertex, an adjacent face, and an opposing face. These occur at a reduced distance of 1.06, 1.48 and 1.83 respectively. These agree with the distances noted on the graph. The coordination number can be deduced from the running integral of the curve and for the 3 peaks are given by 11, 6 &amp;amp; 24 respectively.&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
The Diffusion Coefficients &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; of a simulated gas, liquid and solid were calculated using several different methods:&lt;br /&gt;
&lt;br /&gt;
1) From the Mean Squared Displacement (MSD) of 8,000 simulated atoms, according to the equation &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;
2) From the MSD of a million atoms&lt;br /&gt;
&lt;br /&gt;
3) From the Velocity Autocorrelation Function (VACF), by integration.&lt;br /&gt;
&lt;br /&gt;
4) From the VACF of a million atoms&lt;br /&gt;
&lt;br /&gt;
The results were as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Diffusion Coefficients (unit area/unit time)&lt;br /&gt;
! State !! From MSD (thousand atoms) !! From MSD (million) !! From VCAF (thousand atoms) !! From VCAF (million)&lt;br /&gt;
|-&lt;br /&gt;
| Solid || &amp;lt;math&amp;gt;8.96 \times 10^{-6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.5 \times 10^{-6}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;-1.66 \times 10^{-4}&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;4.55\times 10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Liquid || &amp;lt;math&amp;gt;0.085&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.089&amp;lt;/math&amp;gt; ||&amp;lt;math&amp;gt;0.098&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;0.090&amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Gas || &amp;lt;math&amp;gt;3.22&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;2.38&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.35&amp;lt;/math&amp;gt; || &amp;lt;math&amp;gt;3.09&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We can see from the table that the diffusion coefficients calculated from the same number of atoms agree very well with each other, which suggests that the results are quite precise. However, we can assume that the million atoms simulations inevitably provide more accurate data.&lt;br /&gt;
&lt;br /&gt;
The results also make sense logically, where the gas have the highest diffusion coefficient (they are able to diffuse much faster) than the liquid, and the diffusion coefficient of the solid is close to 0.&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- The Mean Squared Displacement can be used to find the Diffusion Coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, via the following equation:&lt;br /&gt;
&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;
Plotting the mean squared displacement (MSD) against time, then finding the linear gradient would give us the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD1az.jpg|thumb|600px|none]][[File:MSD2az.jpgthumb|600px|none]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the graphs it can be concluded that the final 1000 timesteps follow linearity with which to apply the equations, and thus the diffusion coefficients can be calculated from the last timesteps.&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&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;
Starting from a 1D Harmonic Oscillator:&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;
Differentiating gives the velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v\left(t\right) = -A\omega \sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substituting into the integrated form of the VAFC:&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) \cdot A \omega \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(A \omega \sin\left(\omega t + \phi\right)\right)^2\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) \cdot \sin \left(\omega \left(t+\tau\right)+\phi\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, using the trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin \left(\alpha + \beta \right)= \sin\alpha\cos\beta + \sin\beta\cos\alpha,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sin\left(\omega t + \phi + \omega\tau\right) = \sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \sin\left(\omega t + \phi \right) \cdot \left(\sin\left(\omega t+\phi\right)\cos\left(\omega\tau\right) + \sin\left(\omega\tau\right)\cos\left(\omega t + \phi\right)\right)\mathrm{d}t}{\int_{-\infty}^{\infty} \left(\sin\left(\omega t + \phi\right)\right)^2\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^2\left(\omega t + \phi\right)\cos\left(\omega \tau\right) + \int_{-\infty}^{\infty} \sin \left(\omega \tau\right) \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; is a constant, thus &amp;lt;math&amp;gt;\cos\left(\omega\tau\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sin\left(\omega\tau\right)&amp;lt;/math&amp;gt; can be taken out of the integral.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right) + \sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; can cancel out:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\sin(x)&amp;lt;/math&amp;gt; is an odd function and &amp;lt;math&amp;gt;\cos(x)&amp;lt;/math&amp;gt; is an even function, &amp;lt;math&amp;gt;\sin(x)\cos(x)&amp;lt;/math&amp;gt; is odd.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; is an odd function (While the value of &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; can change whether or not the functions are even or odd, it shifts both functions by the same amount and the resulting &amp;lt;math&amp;gt;\cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; will still be odd)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\therefore C\left(\tau\right)=\cos\left(\omega \tau\right)+\frac{\sin \left(\omega \tau\right) \int_{-\infty}^{\infty} \cos \left(\omega t + \phi\right)\sin\left(\omega t + \phi\right)}{\int_{-\infty}^{\infty} \sin^2\left(\omega t + \phi\right)}=\cos\left(\omega \tau\right)&amp;lt;/math&amp;gt;&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;
[[File:VACFaz.png|thumb|800px|Comparison of Normalised VACF with VACF of Liquid and Solid|left]]&lt;br /&gt;
&lt;br /&gt;
From the graph note that the liquid VACF tends quickly to zero, and the solid has small fluctuations. The difference arises as the in the liquid phase the particles have more translational freedom and can collide, exchanging energy between particles. Solid phase atoms retain a relatively static position around their equilibrium position. Also the solid rate will decay slower than in liquids.&lt;br /&gt;
&lt;br /&gt;
For the harmonic oscillator, the VACF will not decay to zero as the there are atoms exchanging with their neighbours, which do not occur in harmonic oscillation.&lt;br /&gt;
&lt;br /&gt;
[[File:runningintegralaz.png]]&lt;br /&gt;
&lt;br /&gt;
The values for D from the VCAF model were greater in magnitude than those from the MSD calculations. The greatest source of error is most likely to be the use of the trapezium rule instead of an exact integral of each function.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=591817</id>
		<title>Talk:Mod:gogle14</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:gogle14&amp;diff=591817"/>
		<updated>2017-03-01T10:30:50Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  &amp;lt;h2&amp;gt;Introduction to molecular dynamics simulations&amp;lt;/h2&amp;gt; &amp;lt;h3&amp;gt;Analysis of velocity-Verlet integration method&amp;lt;/h3&amp;gt;  T...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Introduction to molecular dynamics simulations&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of velocity-Verlet integration method&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Verlet algorithm can be used to estimate positions, velocities and momenta of particles without the need of continuous integration. Instead, it uses the knowledge of those values at previous points and Taylor expansion to find all of these values at set intervals (timesteps). Below is a comparison of the function &amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi)&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;A=1, \omega =1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi =0&amp;lt;/math&amp;gt;, therefore the function is &amp;lt;math&amp;gt;x(t)=\cos t&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_analytical_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 1.&amp;lt;/b&amp;gt; Comparison of veloity-Verlet and analytical solution of the function.&lt;br /&gt;
&lt;br /&gt;
As can be seen from Figure 1, the results generated by Verlet algorithm match the analytical values closely, indicating how powerful this approximation is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Still, there is some discrepancy present, as indicated in Figure 2 below:&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_error_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 2.&amp;lt;/b&amp;gt; Error analysis for the velocity-Verlet solution.&lt;br /&gt;
&lt;br /&gt;
It can be seen that the error shows an oscillating behaviour (Figure 2), with the local maximum of the error growing consistently over time. This is due to the fact that the Taylor series converge to the real value, but not all terms were taken into account; the first maximum occurs where the fourth term (error term) is the largest. As previous values are used to calculate those at the next timestep, the error is cumulative and therefore increases over time, as predicted by the curve in the graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Verlet_energy_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 3.&amp;lt;/b&amp;gt; Total energy as a function of time for velocity-Verlet method.&lt;br /&gt;
&lt;br /&gt;
Another way of evaluating the usefulness of this algorithm is by seeing how well the predicted values match known values. As an isolated system is modelled, the total energy in the system should remain constant. However, Figure 3 shows that this is not the case and there are small (0.25%) fluctuations from the real value when the timestep of 0.1 is used. This shows that the system, though faithful, is still a simplification of reality, furthermore, it can tolerate even a larger timestep and thus fewer calculations, as 1% error is exceeded only when the timestep is increased to 0.2. This could save computational resources, but it also indicates the balance between the choice of timestep and the correspondence of the model to reality.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Evaluation of the system used&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=4\epsilon \bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\bigg( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}}\bigg)&amp;lt;/math&amp;gt;, multiply by &amp;lt;math&amp;gt;\frac {r_0^6}{\sigma ^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=\frac{\sigma^{6}}{r_0^{6}}-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}}=1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0^{6}=\sigma^{6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=+\sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;or&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=-\sigma &amp;lt;/math&amp;gt; (root invalid, as separation has to &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
This is the separation at which potential energy is 0; the force at this separation is as shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F=-\frac{d \phi (r)}{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r)=4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-\frac {4\epsilon \Big( \frac{\sigma^{12}}{r_0^{12}}-\frac{\sigma^{6}}{r_0^{6}} \Big) }{dr}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=-4 \epsilon \bigg( -12 \frac {\sigma ^{12}}{r_0^{13}} +6 \frac{\sigma ^6}{r_0^7} \bigg)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)=48 \epsilon \frac {\sigma ^{12}}{r_0^{13}} -24 \epsilon \frac {\sigma ^6}{r_0^7}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know that &amp;lt;math&amp;gt;r_0= \sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F(r_0)= \frac {48 \epsilon }{\sigma }- \frac {24 \epsilon }{\sigma }= \frac {24 \epsilon}{\sigma }&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A system is said to be an equilibrium when there is no net force acting on it, i.e., the force is 0. By substituting minimum potential energy expression from above into the minimum force expression, the following formula is obtained:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
F_{eq}=48 \epsilon \frac {\sigma ^{12}}{r_{eq}^{13}} -24 \epsilon \frac {\sigma ^6}{r_{eq}^7}=0&lt;br /&gt;
&amp;lt;/math&amp;gt;, divide by &amp;lt;math&amp;gt;24 \epsilon \frac {\sigma ^6}{r_{eq}^7} &amp;lt;/math&amp;gt; and rearrange:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}^6=2\sigma ^6&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=+\sqrt[6]{2} \sigma \approx 1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
or&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
r_{eq}=-\sqrt[6]{2} \sigma \approx -1.122 \sigma&lt;br /&gt;
&amp;lt;/math&amp;gt; (root invalid, separation has to be &amp;gt;0)&lt;br /&gt;
&lt;br /&gt;
The depth of well characterises how stable the system is. For the equilibrium distance it can be found by substituting the equilibrium &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; value into the Lennard-Jones interaction equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\phi (r_{eq})=4 \epsilon \bigg( \frac{\sigma ^{12}}{(\sqrt[6]{2}\sigma)^{12}}-\frac{\sigma ^{6}}{(\sqrt[6]{2}\sigma)^{6}} \bigg)=4 \epsilon \Big( \frac{1}{4} - \frac{1}{2} \Big)=4 \epsilon \Big( - \frac{1}{4} \Big)=-\epsilon&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To evaluate the integral of the potential energy of the Lennard-Jones potential, let us set the changing lower bound to a value n, which can later be substituted for the necessary value:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} \phi (r) dr=\int_{n}^{\infty} 4\epsilon \bigg( \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}\bigg) dr&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon =\sigma =1&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\int_{n}^{\infty} 4 \bigg( \frac{1}{r^{12}}-\frac{1}{r^{6}}\bigg) dr=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
4\bigg[ \frac {1}{5r^5}- \frac {1}{11r^{11}} \bigg]_n^{\infty}=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( [0]- \bigg( \frac{1}{5n^5} -\frac {1}{11n^{11}} \bigg) \bigg)=&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;4 \bigg( \frac {1}{11n^{11}}-\frac {1}{5n^5} \bigg) \approx -\frac {4}{5n^5}  &lt;br /&gt;
&amp;lt;/math&amp;gt;, as first term becomes negligible&lt;br /&gt;
&lt;br /&gt;
Let us substitute in the lower bound values (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is still 1):&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=2.5 \sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0082&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;n=3\sigma &amp;lt;/math&amp;gt;, the value is &amp;lt;math&amp;gt;-0.0033&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to understand the scale of the system, let us compare the number of water particles in 1 mL of water to the volume of water that could be simulated. The number of water particles in 1 mL of water under standard conditions can be determined like this&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=\rho \times V=0.9982 \times 1=0.9982 (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{m}{N}=\frac{0.9982}{18.02}=5.539 \times 10^{-2}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
N=n \times N_A=5.539 \times 10^{-2} \times 6.023 \times 10^{23}=3.336 \times 10^{22}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Meanwhile, 10000 molecules of water occupy this volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
n=\frac{N}{N_A}=\frac{10000}{6.023 \times 10^{23}}=1.660 \times 10^{-20}  (mol)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
m=n \times M=18.02 \times 1.660 \times 10^{-20}=2.989 \times 10^{-19} (g)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
V=m \times \rho=2.989 \times 10^{-19} \times 0.9982=2.983 \times 10^{-19} (mL)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From these results it can be seen that the volumes simulated are absolutely minuscule: 18 orders of magnitude less than a single mL of water. However, even such small amounts are enough to provide us with values applicable to the macroscopic world.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The system also uses boundary conditions in order to ensure that the simulated environment is close to reality while also being easy to simulate&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
(0.5, 0.5, 0.5)+&lt;br /&gt;
(0.7, 0.6, 0.2)=&lt;br /&gt;
(1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;, which is &lt;br /&gt;
&amp;lt;math&amp;gt;(0.2, 0.1, 0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
after applying boundary conditions according to which each atom regenerates at the opposite into the cube each time it crosses its boundaries; no coordinate can exceed 1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These simulations also make use of reduced units. It is done purely out of convenience so that the output and input could be as close to easily operable numbers while also having a physical meaning. For example, conversion from reduced to real units for Argon can be achieved as follows:&lt;br /&gt;
&lt;br /&gt;
1)Lennard-Jones cutoff distance of 3.2 units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r*\sigma=3.2 \times 3.4\times 10^{-10}=1.09 \times 10^{-9} (m)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2)Well depth&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_{well}=-\epsilon =120\times k_b \times N_A=120\times R=120 \times 8.31=998 (J\ \ mol^{-1})=0.998 (kJ\ \ mol^{-1})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3)Temperature of 1.5 reduced units&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac {\epsilon T*}{k_B}=1.5 \times 120=180 (K)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Equilibriation&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A randomly generated grouping of atoms can (and, with a large number of generated atoms, likely will) occupy thermodynamically unfeasible positions, for example, they might have overlapping van der Waals radii if generated in close proximity, which would give the atoms a larger potential energy and see them repel strongly (large kinetic energy) once the simulation is started. In normal situations the kinetic temperatures would be described by the Maxwell-Boltzmann distribution, but in the artificially created system it therefore might not be the case. In reality, all atoms occupy space and have velocities and momenta starting from a realistic previous thermodynamic state; for this reason it is better to simulate the melting of a crystal, where the initial positions can be simulated to match reality closely.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsion forces in the initial system configuration can make the simulation unstable and cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The density used in this simulation is number density: the number of atoms per unit volume. Let us consider a cubic unit cell, where all cell parameters are equal:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho _n=\frac {N}{V}=\frac {N}{a^3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number density of 0.8 gives the following cell parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{N}{\rho _n}}=\sqrt[3]{\frac{1}{0.8}}=1.07722&amp;lt;/math&amp;gt;, which matches the values given by the program&lt;br /&gt;
&lt;br /&gt;
This formula also allows to predict the side length of an fcc cell with the number density of 1.2; an fcc cell contains 4 atoms: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;a=\sqrt[3]{\frac{4}{1.2}}=1.49380&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of atoms generated is dependent on the size of the box as well as the type of lattice used. For our initial box of a size of 10×10×10, 1000 unit cells were be generated. If fcc unit cells were to be generated instead, we would create 4000 atoms, as each fcc cell has 4 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
In order to run the simulation, knowledge of the code used is important. These three lines set the type of interactions the atoms will have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line sets the mass of each atom type. In this case, all atoms are type 1 and therefore mass is set to be 1.0 for all atoms&lt;br /&gt;
&lt;br /&gt;
The second line sets the type of force-field interaction and the cut-off distance after which there is considered to be no interaction. In this case, each atom pair interacts according to Lennard-Jones potential and the atoms are considered as non-interacting if the reduced distance is 3 or larger.&lt;br /&gt;
&lt;br /&gt;
The third line sets the strength of interaction between an atom pair. In this case, the two placeholder asterisks signify that any atom with any other atom interacts with a force-field coefficient of 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why is a cutoff used?  What are the forcefield coefficients considering that we&#039;re using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Considering that for each atom both a position and a velocity are set, we can conclude that the aforementioned velocity-Verlet integration algorithm will be used. In this case, the positions are set as crystal lattice points and the velocities are randomly assigned to obey the Maxwell-Boltzmann distribution, which is a feasible thermodynamic starting point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the length of equilibriation for the system can be estimated, computations can be run to cover that particular amount of time (100 units in the given case). Defining the timestep and letting the number of steps run be defined by the number of timesteps used can achieves a situation where only changing the timestep still lets the simulation run for the same amount of time, therefore making it simpler. Conversly, the other code means that each time a timestep is defined, the number of runs would also have to be entered manually in order to reach the same length of simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, using variables makes it easy to change the value of certain parameters in the simulation, with all commands dependent on that parameter updating automatically.  Make it clear which task you are answering.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Evst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 4.&amp;lt;/b&amp;gt; Equilibriation of energy over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_Tvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 5.&amp;lt;/b&amp;gt; Equilibriation of temperature over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:eq_pvst.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 6.&amp;lt;/b&amp;gt; Equilibriation of pressure over time for 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
From Figures 3, 4 and 5 it can be seen that all the calculated parameters reach an equilibrium quickly for the timestep of 0.001, which indicates that it is a particularly precise timestep to use.&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_Evst_all.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 7.&amp;lt;/b&amp;gt; Comparison of equilibriation of energy over time between different timesteps&lt;br /&gt;
&lt;br /&gt;
[[File:Eq_table_eq_timesteps.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 8&amp;lt;/b&amp;gt; Average energy for each equilibriated timestep.&lt;br /&gt;
&lt;br /&gt;
In Figure 7 it is visible that all timesteps equal to and lower than 0.01 reach an equilibrium, meaning that they all can be used for simulations to varying degrees of success. The 0.015 timestep fails to reach an equilibrium at all and also provides a visibly different energy than the others, indicating that it cannot be used to simulate the liquids.&lt;br /&gt;
&lt;br /&gt;
From the remaining timestep values the average energies were extracted (Figure 8); it becomes evident that the difference between the 0.001 and 0.0025 timesteps is insignificant, while those for the higher timesteps are further from physical reality. Given the closeness of their results, 0.0025 timestep is a better choice than 0.001, as the same number of steps can cover 2.5 more time with a fixed number of steps simulated. Though not relevant to this particular simulation, this can become useful in situations when the system takes longer to reach an equilibrium, or to save computational resources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, average energy shouldn&#039;t depend on the timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Simulations under specific conditions&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Setting up the system&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We know that:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B T&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also at the end of each time step each velocity is multiplied by &amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt; to give the desired temperature &amp;lt;math&amp;gt;\mathfrak{T} &amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum _i m_i (\gamma v_i)^2=\frac{3}{2}Nk_B\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{\gamma ^2}{2}\sum _i m_i v_i^2=\frac{3}{2}Nk_B\mathfrak{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After dividing by the original equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma ^2=\frac{\mathfrak{T}}{T}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In the script there is a line saying:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The variables starting with v_ show the output values that will be generated at each set interval. The interval at which the output is given is set by the fist number following the ave/time command; in this case it is 100, meaning that the output is generated every 100 timesteps. The second number sets the number of times the input values will be used, in this case, it is 1000 times. The last number (100000) sets the frequency at which the average output values are generated. As the next line of the script is as follows&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the average value generated will also be the overall average value, generated from 100000/100=1000 values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to compare the simulated values to the ideal gas equation, first we must rewrite it in reduced units. The ideal gas law states that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;pV=Nk_BT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As&lt;br /&gt;
&amp;lt;math&amp;gt;p=p^* \frac{\epsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\frac{\epsilon}{k_B}&amp;lt;/math&amp;gt; and &lt;br /&gt;
&amp;lt;math&amp;gt;\rho =\frac {\rho ^*}{\sigma ^3}&amp;lt;/math&amp;gt;, we can substitute these values into the ideal gas equation, which gives the ideal gas equation in reduced units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=\frac{p^*}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are expressing density as a function of temperature, it is visible that reduced density is inversely proportional to reduced temperature with the gradient of reduced pressure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\rho ^*=p^*\times \frac{1}{T^*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Analysis of densities&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:density_vs_temp.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 9.&amp;lt;/b&amp;gt; Calculated densities at different temperatures and pressures.&lt;br /&gt;
&lt;br /&gt;
Figure 9 shows that at constant pressure, density is decreasing with temperature. Furthermore, increased pressure increases the density at the same temperature; both of these facts match the physical reality and therefore the simulation has been at least somewhat successful. However, the theoretical density values for an ideal gas are dramatically higher for the same temperature. It is due to the fact that the ideal gas equation completely ignores any intermolecular interactions, including the repulsive ones that dominate at this pressure and cause the atoms to increase their internuclear distances. As the system is warmed up, the discrepancy between both the ideal and non-ideal gas start to disappear, as at higher temperatures densities decrease, the space between atoms increase and real gases start to behave similar to ideal gases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Heat capacity&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was the code used to run the heat capacity experiments. New output variables were defined and mentions of pressure were deleted, as it is not necessary to be measured. This code was used to run the simulation at density of 0.2 and temperature of 2.2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable density equal 0.2 &lt;br /&gt;
lattice sc ${density}&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.2&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;
reset_timestep 0&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&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 density atoms&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temper equal temp&lt;br /&gt;
variable temper2 equal temp*temp&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable energytotal equal etotal&lt;br /&gt;
variable energytotal2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temper v_dens2 v_temper2 v_energytotal v_energytotal2&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 heatcap equal ${n}*${dens}*(f_aves[6]-f_aves[5]*f_aves[5])/(f_aves[2]*f_aves[2])&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;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of the file can be viewed below:&lt;br /&gt;
&lt;br /&gt;
[[File:Heat_cap_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 10.&amp;lt;/b&amp;gt; Heat capacity as a function of temperature at p=0.2 and p=0.8&lt;br /&gt;
&lt;br /&gt;
Both pressures show a reduction in heat capacity with increasing temperature (Figure 10). As higher heat capacity correlates with a higher number of rotational, vibrational and other thermally reachable states and more accessible degrees of freedom, it is logical that with increasing temperature the number of states accessible with further increase would drop and therefore the heat capacity would decrease (i.e., more heat energy is converted to kinetic energy in hot molecules than cold molecules). The curve at 0.8 units reduced pressure has a peculiar hump around 2.3-2.4 temperature, indicating that in those particular circumstances there is a higher density of states for some reason that would need further investigation.&lt;br /&gt;
&lt;br /&gt;
It can also be seen that larger pressure applied to a system at a certain temperature would increase the heat capacity over volume. This is due to the fact that now a unit volume contains more molecules and therefore has more accessible states. In other words, the increased pressure increases density and thus the density of states as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Radial distribution function&amp;lt;/h2&amp;gt;&lt;br /&gt;
[[File:RDF_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 11.&amp;lt;/b&amp;gt; Radial distribution function for a solid, liquid and vapour&lt;br /&gt;
&lt;br /&gt;
Simulations in Figure 11 run at density of 1.15 and temperatures of 0.07, 0.7 and 1.2 to obtain vapour, liquid and solid respectively. The radial distribution functions (RDF) of each phase show some similar features with the the values of 0 up to radii values of around 0.8, followed by one or more peaks and then largely tending to 1. The radial distribution function illustrates the probability of finding at atom at a certain distance from the origin atom. As all atoms repel over short distances, spectra for all three phases show that there there are no other atoms in direct vicinity of the origin atom. Directly outside of this sphere the probability of finding an atom is relatively large, corresponding to the attractive and repulsive parts of Lennard-Jones potential respectively. The function then tends to normalise to 1.&lt;br /&gt;
&lt;br /&gt;
However, there are marked differences in the number of peaks close to atoms in each phase. Gases only get one initial peak, as gas particles interact very weakly and have larger distances between them, therefore they do not have any long-range structure. Liquids show three discernible peaks due to the fact that there exists a short-range structure, as liquid particles are in closer proximity due to existing attractive forces between them. After that, the function tends to 1, indicating a lack of long-range structure. The solids have a large number of peaks, as they exist in crystalline forms and therefore have a large amount of both short-range and long-range structure. Crystals are periodic, therefore as the radius grows, the imaginary sphere crosses either empty space or several atoms in all directions, giving rise to many discernible peaks. Even though the RDF value tends to 1 over time, it can never reach it and shows oscillatory behaviour instead because of the high order of long-range structure present in crystals.&lt;br /&gt;
 &lt;br /&gt;
[[File:gatis_lattice_illustration.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 12.&amp;lt;/b&amp;gt; Illustration of the lattice structure.&lt;br /&gt;
&lt;br /&gt;
Illustrated above is the connectivity in the fcc lattice; the red atom is the atom of origin. It is visible that the closest atoms are located on the faces of the cube which intersect at the origin point. The distance a is half of a diagonal of the face of the cube, i.e., it is equal to &amp;lt;math&amp;gt;\frac{\sqrt{2}}{2}a_l&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;a_l&amp;lt;/math&amp;gt; is the lattice parameter. The next closest atoms is the corner of the cube, and distance b is therefore equal to the lattice paramter. Third closest atoms can be found on the centres of the faces of the cube that do not contain the origin point. The distance c can be calculated as the hypotenuse of the right triangle one side of which is distance a and the other one is one side of distance b, it is therefore &amp;lt;math&amp;gt;c=\sqrt{1^2+\bigg(\frac{\sqrt{2}}{2}\bigg)^2}a_l=\sqrt{\frac{3}{2}}a_l&amp;lt;/math&amp;gt;. The positions of the first three peaks on the RDF rougly correspond to the coefficients of the theoretical distance values by a factor of 1.5, as they are at radii of 1.025, 1.475 and 1.925 respectively.&lt;br /&gt;
&lt;br /&gt;
The area under each peak is proportional to the number of atoms it corresponds to. As the origin atom is in the corner of this cube, it is also simulatanously part of &amp;lt;math&amp;gt;2^3=8&amp;lt;/math&amp;gt; cubes, and so are the atoms close to it. &lt;br /&gt;
There are 3 blue atoms in each of the 8 cubes, but each blue atom is on the face of the cube and is therefore shared between two cubes, so there are &amp;lt;math&amp;gt;\frac{3\times 8}{2}=12&amp;lt;/math&amp;gt; blue atoms coordinated with the origin atom.&lt;br /&gt;
&lt;br /&gt;
There are 3 green atoms in each of the 8 cubes in the coordination sphere, however, as each green atom is on the corner of the adjacent cubes, each of them is shared between 4 cubes in the coordination sphere, therefore &amp;lt;math&amp;gt;\frac{3\times 8}{4}=6&amp;lt;/math&amp;gt; green atoms coordinate with the origin.&lt;br /&gt;
&lt;br /&gt;
None of the orange atoms are part of another cube in the coordination sphere, therefore there are &amp;lt;math&amp;gt;3\times 8=24&amp;lt;/math&amp;gt; orange atoms within distance c of the origin atom.&lt;br /&gt;
&lt;br /&gt;
From the obtained values we can see that the intensity of each peak also mathces what is expected from theory, therefore it can be concluded that the RDF provides useful information about both long-range and short-range structure of solids.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Dynamical properties and diffusion coefficient &amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;Mean square displacement&amp;lt;/h3&amp;gt;&lt;br /&gt;
[[File:MSD_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 13.&amp;lt;/b&amp;gt; Mean square displacement for a gas, liquid and solid.&lt;br /&gt;
&lt;br /&gt;
In Figure 13, the calculated values are represented with a warm (red-orange-gold) colour scheme, while the given values from 1000000 atoms are shown with a cool (blue-turquoise-green) colour scheme.&lt;br /&gt;
&lt;br /&gt;
The simulated values completely correspond to what is expected from theory: in solid phase the atoms remain almost completely static due to their being in a crystal structure. In both liquid phase and vapour phase the mean square displacement (MSD) increases with time, tending towards a straight line behaviour (pure diffusive behaviour). As liquids have more attractive forces than gases and they are denser, clearly the MSD should be much lower in them than vapour phase; indeed, this behaviour is corroborated by the calculated values.&lt;br /&gt;
&lt;br /&gt;
The provided results of a simulation of 1000000 atoms shows a very similar qualitative behaviour, especially in the solid phase. The provided simulation shows a somewhat lower rate of increase in MSD than the independently run calculation with the opposite being true for the vapour phases. However, it is difficult to speculate about the reasons why this could be the case due to the uncertainty about what conditions were used in the simulations provided.&lt;br /&gt;
&lt;br /&gt;
As it is known that &amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta \langle r^2 (t)\rangle}{\delta t}&amp;lt;/math&amp;gt;, it can also be seen that the diffusion coefficient is &amp;lt;math&amp;gt;\frac{1}{6}&amp;lt;/math&amp;gt; of the gradient at the linear component of the curve. As the graph shows the gradient in the units of the timestep, each gradient has to be divided by the length of the timestep (0.002). The obtained diffusion coefficients are as shown in Figure 14:&lt;br /&gt;
&lt;br /&gt;
[[File:Dif_coef_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 14.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from the gradients of MSD functions&lt;br /&gt;
&lt;br /&gt;
As can be seen, the diffusion coefficient is negligible in solids and about an order of magnitude larger in gases than it is in liquids. A relatively good agreement between the independently simulated values and the values obtained from the provided data can be observed. As diffusion is measured in units of distance squared over time, in this case the units change depending on what the reduced length is equal to as well as the length of one time unit used.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3&amp;gt;Velocity autocorrection function&amp;lt;/h3&amp;gt;&lt;br /&gt;
The velocity autocorrection function (VACF) for a harmonic oscillator can be solved as follows:&lt;br /&gt;
It is known that&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{v(t)v(t+\tau ) dt}}{\int_{-\infty }^{\infty}{v^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also known that harmonic oscillator is described by&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t+\phi )&amp;lt;/math&amp;gt;, which differentiates into &amp;lt;math&amp;gt;v(t)=-A\omega \sin (\omega t+\phi )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us substitute it into the autocorrection formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{A\omega \sin (\omega t+\phi )A\omega \sin (\omega (t+\tau) +\phi ) dt}}{\int_{-\infty }^{\infty}{(A\omega \sin (\omega t+\phi ))^2 dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;A^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\omega ^2&amp;lt;/math&amp;gt; cancel out (constants); &amp;lt;math&amp;gt;\sin (\omega (t+\tau )+\phi )&amp;lt;/math&amp;gt; expanded as per a basic trigonometric identity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\int_{-\infty }^{\infty}{\sin (\omega t+\phi )(\sin (\omega t +\phi )\cos (\omega \tau)+(\sin (\omega \tau)\cos (\omega t+\phi )) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
separate and bring out constants:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau )=\frac{\cos (\omega \tau)\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}+\frac{\sin (\omega \tau)\int_{-\infty }^{\infty}{\sin (\omega t+\phi )\cos (\omega t+\phi ) dt}}{\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the left hand side summand &amp;lt;math&amp;gt;\int_{-\infty }^{\infty}{\sin ^2(\omega t+\phi ) dt}&amp;lt;/math&amp;gt; cancel out; in the right hand side summand the odd function&lt;br /&gt;
&amp;lt;math&amp;gt;\sin (\omega t+\phi )\cos (\omega t+\phi )&amp;lt;/math&amp;gt; is integrated over the real number axis, giving 0 as the value of the second summand. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;c(\tau )=\cos (\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 15.&amp;lt;/b&amp;gt; Velocity autocorrection functions for a liquid, a solid and a harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
As is seen in the Figure 15, both for the liquid and the gas VACF values start high and then with different degrees of oscillatory behaviour approach 0, which means complete lack of correlation. It makes physical sense, as in the beginning the original velocity is the only velocity, but its effect starts to decrease as kinetic energy either is lost to rotational/vibrational energy or is affected by collisions with other particles. Subsequently, the harmonic oscillator correctly predicts oscillations and both liquids and gases tend to change their velocity over time until the original velocity has very little impact on the final velocity. The difference lies in the fact that for solids the oscillation phase lasts much longer, while liquids tend to decorrelate faster. This is due to liquids being in a less structured environment with a larger risk of collision, while for solids in crystalline environments collisions are more limited and they have less kinetic energy, therefore it takes longer to lose the original velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic VACFs show oscillations, but not the decay to 0 present in the simulated functions. This is due to the fact that harmonic approximation is only valid for atoms in vacuum or very close to the bottom of the Lennard_Jones well and does not take into account the inherent anharmonicity of the system or the possibility of collisions, meaning that the original velocity remains.&lt;br /&gt;
&lt;br /&gt;
[[File:Diffusion_vacf_gatis.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Figure 16.&amp;lt;/b&amp;gt; Diffusion coefficients as obtained from VACF graphs by trapezoidal method.&lt;br /&gt;
&lt;br /&gt;
From Figure 16 it can be seen that the diffusion coefficients vary widely between the independent simulation and the given data for a million atoms. For solids the trapezoidal method proved especially difficult, as the diffusion coefficient is close to 0 and it does not offer that level of precision. Both precision and accuracy are issues when using the trapezoidal method on VACF graphs, however, when compared to the values obtained by using the gradient (Figure 14), the value for all three easily matched to the same order of magnitude and even better (0.088 obtained for both liquids simulated with 1,000,000 atoms). Therefore it can be concluded the using the trapezoidal method provides a good estimate of what the diffusion coefficient might be.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2&amp;gt;Conclusion&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulations can be used to obtain a large volume of quality data that would otherwise be less accessible due to how even simple models can provide relatively accurate data. They can be used as a tool to investigate new systems with desired properties and supplement purely experimental data collection.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:APPLEBANANAKIWI&amp;diff=591816</id>
		<title>Talk:Mod:APPLEBANANAKIWI</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:APPLEBANANAKIWI&amp;diff=591816"/>
		<updated>2017-03-01T04:13:55Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report with detailed answers given to all tasks.  Make sure that you understand the background theory behind the last few tasks so that you can fully explain what your results show.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below in Figure 1 is the graph for the displacement &amp;lt;math&amp;gt;x\left(t\right)&amp;lt;/math&amp;gt; calculated using firstly the Verlet algorithm and secondly the analytical solution using the classical harmonic oscillator. Latter reduces down to &amp;lt;math&amp;gt; x\left(t\right) = \cos\left(t\right)&amp;lt;/math&amp;gt; as all the parameters are set to either zero or one. From the direct comparison on this relatively low resolution graph no significant deviation is observed. &lt;br /&gt;
In Figure 2 the total energy versus time is shown at a time step of 0.1. The total energy was calculated as a sum of kinetic and potential energies and given in reduced form (as both the force constant k as well as the mass equals to one): &amp;lt;math&amp;gt;E_T = \frac{1}{2} \left(v^{2}+x^{2}\right)&amp;lt;/math&amp;gt;. This expression originates from the kinetic energy expression &amp;lt;math&amp;gt;E_K= \frac{1}{2}m v^{2}&amp;lt;/math&amp;gt; and the potential energy expression &amp;lt;math&amp;gt;E_P= \frac{1}{2}k x^{2}&amp;lt;/math&amp;gt; which represents the potential energy gained as a function of displacement from the equilibrium distance.&lt;br /&gt;
&lt;br /&gt;
[[File:DisplacementMAS.png|thumb|centre|500px|Figure 1: Displacement|none]] &lt;br /&gt;
[[File:TOTEnergyMAS.png|thumb|centre|500px|Figure 2: Total Energy|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error between the Verlet algorithm and the classical harmonic oscillator seems to increase with time according to the equation in the diagram. It has to be noted that the error has a local maxima every time the displacement reaches zero and a local minima every time the displacement is at a turning point.&lt;br /&gt;
&lt;br /&gt;
[[File: ERROR0.1MAS.png |thumb|centre|500px|Figure 3: Error|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A wide range of time steps were used ranging from &amp;lt;math&amp;gt;t = 0.01&amp;lt;/math&amp;gt; up to &amp;lt;math&amp;gt;t = 0.5&amp;lt;/math&amp;gt;. The table below represent the maximum error found in the simulations. As expected the error increased with higher time steps while it decreased with smaller time steps. The threshold of decreasing the error below 1% (0.01 in absolute values) of the displacement seemed to be just around &amp;lt;math&amp;gt;t = 0.2&amp;lt;/math&amp;gt;. It has to be noted that the percentage error of displacement will be proportionate to the percentage error in total energy as former is used to calculate the latter. Any calculation with a time step lower than 0.2 would therefore yield a sufficiently accurate result. However, it has to be noted that by decreasing the time step the length of the simulation decreases as well. In order to evaluate the same amount of steps one would have to run the calculation longer. It essentially comes down to a trade-off between computational duration and accuracy of results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!Error in Displacement (absolute values)&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.000006&lt;br /&gt;
|-&lt;br /&gt;
|0.05&lt;br /&gt;
|0.0005&lt;br /&gt;
|-&lt;br /&gt;
|0.075&lt;br /&gt;
|0.002&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|0.09&lt;br /&gt;
|-&lt;br /&gt;
|0.5&lt;br /&gt;
|0.7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, but why is it important to check that total energy doesn&#039;t fluctuate too much?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|For a single interaction the Lennard-Jones potential is shown. It consists of the combination of the repulsive part which dominates at small distances and the attractive term which dominates at larger distances. Here it is set to zero to find &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|In order for the function to equal zero either the inside of the brackets has to equal to zero (or the constant &amp;lt;math&amp;gt;\epsilon = 0&amp;lt;/math&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sigma^6}{r^6} \left( \frac{\sigma^6}{r^6} - 1 \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|Factorising and realising that the expression inside the brackets has to equal to zero (or the constant &amp;lt;math&amp;gt;\sigma = 0&amp;lt;/math&amp;gt;). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sigma^6}{r^6} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
|rearranging and taking the sixth root leads to the next line&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r_0 =\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|Alternatively, when &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; approaches infinity would also yield the potential to approach zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;\mathbf{F}_i &amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The force at this separation is given by the derivative of the potential with respect to the distance. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|This is the expression for that one interaction described in the previous example. Setting &amp;lt;math&amp;gt;r =\sigma&amp;lt;/math&amp;gt; and rearranging leads to the next line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The force thus depends on both the depth of the potential well as well as the distance &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; (which is essentially &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;- \mathbf{F}_i = - 4\epsilon \left(\frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|In order to find the equilibrium distance the derivative of the potential (negative force) has to be set to zero in order to find that minima. Using the same reasoning as in the above example, the expression inside the brackets should equal to zero.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{6\sigma^6}{r^7} \left( \frac{2\sigma^6}{r^6} - 1 \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|Using the expression of the inside of the brackets and setting it to zero again leads to the final line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r_{eq} =2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|The equilibrium distance is proportional to the parameter distance &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of the depth of the potential well&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U= 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Substituting the value for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; obtained above into the expression of the potential.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U= 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Simplifying the fractions leads to the final line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|The depth of the potential well is proportional to &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, which makes sense as this is the parameter which controls this property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Evaluation of the total interaction integrals&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{\alpha}^\infty 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|Setting the parameters to one (as instructed) and changing the lower limit of the integral to &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; allows a general approach.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{\alpha}^\infty \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^5} \right) |_{\alpha}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
|This is a standard integration. For the upper bound the integral evaluates to zero, while the lower bound is shown in the next line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{\alpha}^\infty \phi\left(r\right)\mathrm{d}r = 4\left( \frac{1}{11\alpha^{11}} - \frac{1}{5\alpha^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|This expression can now be evaluated for different values of &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; as shown below.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\alpha = 2&amp;lt;/math&amp;gt; gives an integral of &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\alpha = 2.5&amp;lt;/math&amp;gt; gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\alpha = 3&amp;lt;/math&amp;gt; gives &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|The integral will become smaller with increasing lower limit and eventually tend to zero. In the physical world this corresponds to the two particles losing all interaction at infinite distance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Estimation of the water molecule properties&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;No_{Molecules} = \frac{6.023 \times 10^{23}}{18} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
|1 ml of water corresponds to 1 g at room temperature and pressure. Considering the molar mass of water is approximately 18.015 g/mol, means that the inverse of this number is the amount of matter (in mole) in 1 g. In order to find the number of molecules that inverse has to be multiplied by Avogado&#039;s constant.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;V_{10000 Molecules}= \frac{m}{\rho}  = \frac{10000 \times 18}{6.023 \times 10^{23}} = 2.99 \times 10^{-19} mL&amp;lt;/math&amp;gt;&lt;br /&gt;
|The volume is related to the mass through the density (equal to one at standard conditions). The mass of 10000 molecules obtained by dividing the molar mass by Avogado&#039;s constant to obtain the mass of one molecule and then multiplying it with 10000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of a position Vector&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\vec{v} = \left(0.5, 0.5, 0.5\right) + \left(0.7, 0.6, 0.2\right) = \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Simple vector addition before boundary conditions are applied.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\vec{v} = \left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|The boundary conditions impose a cutoff in all dimensions at one, which results in following position vector. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of LJ parameters in real units for argon&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r = \sigma r*= 1.09 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
|LJ cutoff in real units&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\epsilon = R \times 120 K = 0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|By multiplying with the gas constant one can immediately obtain the well depth.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T = \frac{\epsilon T*}{k_B}=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
|Temperature in real units.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Equilibration=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This could cause problems as the atoms could be initiated on top of each other, i.e. one atom would be occupying space which shouldn&#039;t be available. Likewise this would lead to a false representation of the interaction as it is unlikely that two atoms would ever get that close to each other (infinitely high potential).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The high repulsive forces caused by overlapping particles would make the simulation unstable and could cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Number density of lattice points&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho = \frac{n_{atoms}}{V} = \frac{1}{1.07722^3}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
|The number density is given by the number of atoms per unit volume. For a simple cubic lattice with one atom and sides of equal length one can simplify the expression as shown. This leads to the number density of lattice points of 0.8. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;L = \left(\frac{n_{atoms}}{\rho}\right)^\frac{1}{3}=\left(\frac{4}{1.2}\right)^\frac{1}{3}=1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
|Rearranging the equation above leads to a side length of 1.49. It has to be noted that the fcc-lattice contains 4 atoms instead of only 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As 1000 unit cells are created with the command four times the amount of atoms are created. Hence 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command refers to the mass assignment of the atoms. The first parameter defines the type of atom (which in our case is always one) and the second command assigns that type a mass (in our case 1.0).&lt;br /&gt;
&lt;br /&gt;
The second command defines the pairwise interaction for the atoms of the system (given by the lj). The cut 3.0 corresponds to the cutoff at a distance of 3.0 (reduced units) as the relevant part of the interaction happens in the region below the cutoff (as shown with the integral calculation in the previous section). This is done to save some computational time. &lt;br /&gt;
&lt;br /&gt;
The third command defines the coefficients of the LJ potential &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; (sets them equal to 1 here). The two stars correspond to the atoms this constrain applies on (stars symbolise it applying to all atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm given the specified starting parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below. The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason the longer code is used is that it automatically calculates and changes the number of steps the simulation has to run when a time step is given as input. In the short code this would have to be done manually. Additionally the use of named variables makes the code more user friendly, easier to follow and easier for subsequent parameter changes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first three graphs are the plots for pressure, temperature and energy against time for the 0.001 time step in the time region of 0 to 5. This showed to be sufficient even though the simulation run further until 100. However the noise remained constant around the plateaued trend line and was cut off to identify the time it takes for the simulation to reach equilibrium. This was observed to be just below 0.5 and thus happens very fast. After that the values fluctuate around a constant average value for the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
[[File:PRESSURE0.0001MAS.png|thumb|centre|400px|Figure 4: Pressure|none]] &lt;br /&gt;
[[File:TEMPERATURE0.000MAS1.png|thumb|centre|400px|Figure 5: Temperature|none]]&lt;br /&gt;
[[File:TOTALENERGY0.000MAS1.png|thumb|centre|400px|Figure 6: Total Energy|none]] &lt;br /&gt;
&lt;br /&gt;
The time step that showed the biggest deviation is unsurprisingly the largest time step of 0.015. Both the two lowest time steps 0.001 and 0.0025 seem to have the same average total energy and seem to give similar data quality. Thus it would be sensible to chose the 0.0025 to still give acceptable results as it has a lower computational cost compared to a time step of 0.001. The reason for not choosing a larger time step is the possibility that the system diverges or doesn&#039;t give an accurate representation of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy shouldn&#039;t depend on the timestep so 0.0075 and 0.01 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: TOTALENERGYALLMAS.png |thumb|centre|400px|Figure 7: Total Energy of all time step systems|none]]&lt;br /&gt;
&lt;br /&gt;
=Running simulations under specific conditions=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A Temperature range of 1.5, 1.7, 1.9, 2.1 and 2.3 was chosen as well as the pressures 2.4 and 2.6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Finding and expression for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{1}{2}\sum m_iv_i^2=\frac{3}{2}Nk_BT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum m_i(\gamma v_i)^2=\frac{3}{2}Nk_B\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The second equation originates from multiplying the velocity with &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; resulting in a new Temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. Dividing the upper equation by the lower equation leads to the next line. (Note that gamma can be taken outside the summation as it is a constant.)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Everything cancels apart from the displayed equation.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\gamma = \pm\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
| Hence shown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 100 indicates that every 100th input is sampled and used to calculate the average. The 1000 indicates that there will be 1000 data points used to calculate the average. The 100000 corresponds to the amount of steps after which an average is calculated. So using a time step of 0.0025 and a run of 100000 results in a total simulated time of 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below are the graphs for the densities at pressures 2.4 and 2.6 respectively. The densities seem to decrease with increasing temperatures at both pressures. This is most likely due to the the expansion of the material with increasing temperature that leads to the decrease in density. The values of the two graphs only differ slightly from each other and both simulated densities lie lower than the data obtained through the ideal gas law. This is due to the ideal gas law assuming no interactions between atoms and no excluded volume which allows particles to be in very very close proximity of each other without being repelled. As those factors are present in the simulation it forces the particles at larger distance thus decreasing the overall density in comparison to the ideal gas law. The discrepancy between the two methods increases with pressure as the repulsion increases with higher pressure and thus the gap between ideal gas and simulation increases as well. &lt;br /&gt;
&lt;br /&gt;
[[File:PRESSURE2.4MAS.png|thumb|centre|400px|Figure 8: Density against Temperature at a Pressure of 2.4|none]]&lt;br /&gt;
[[File:PRESSURE2.6MAS.png|thumb|centre|400px|Figure 9: Density against Temperature at a Pressure of 2.6|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct explanation, show all data on a single graph to make it clear that the simulated and ideal gas results are closer at lower pressure.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Calculating heat capacities using statistical physics=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, the heat capacity per volume decreases with increasing temperature. This has to the do with the density of states of the system. At higher temperature the higher energy states become more populated and thus less energy is required to obtain the same final state so that less heat is absorbed. &lt;br /&gt;
Secondly the heat capacity per volume increases with increasing density. This has to do with the increase in atoms in the system at constant volume. As there are more atoms they require more energy to raise the temperature. &lt;br /&gt;
Thirdly, according to thermodynamic predictions the heat capacity was expected to be a constant independent of temperature (i.e. 1.5 R).&lt;br /&gt;
&lt;br /&gt;
[[File: HEATCAPMAS.png |thumb|centre|500px|Figure 10: Heat capacity per volume vs Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestions, more analysis would be needed to investigate why the heat capacity has this trend with temperature.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script is given below. The main features that were changed from the script of the previous sections are in the #MEASURE SYSTEM STATE# section. New variables were introduced for additional data to be collected. Additionally new properties like the heat capacity and number of atoms were added. The heat capacity per volume was calculated directly through the fact that &amp;lt;math&amp;gt;\frac{C_V}{V} = N \rho\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;. This evaluates the expression directly without having to calculate the volume of the system first. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable sysdens equal 0.2&lt;br /&gt;
lattice sc ${sysdens}&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 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp atoms density&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable totenergy equal etotal&lt;br /&gt;
variable totenergy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable dens equal density&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_totenergy v_totenergy2 v_temp v_temp2 v_dens&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable heatcap equal ${n2}*(f_aves[2]-f_aves[1]*f_aves[1])/f_aves[4]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avedens equal f_aves[5]&lt;br /&gt;
variable heatcappervol equal ${n}*f_aves[5]*(f_aves[2]-f_aves[1]*f_aves[1])/f_aves[4]&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;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity per Volume: ${heatcappervol}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Atoms: ${n}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Structural properties and the radial distribution function=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The radial distribution function gives the electron density as a function of r. It is used to evaluate the order of the system. The RDF for the solid is the most distinct and complex and shows well defined peaks at various distances. This indicates that electron density is particularly high at those distances, probably due to neighbouring particles fixed in space through the solid structure (most ordered system). Both the liquid and the vapour phase have a plateaued line (at 1 - the system density) which indicates that their neighbours are at random distances and not fixed (i.e. constantly in motion). However, they have an initial peak which looks very similar to the inverted LJ potential. The maxima indicates that the electron density is highest in the potential well of the interaction with the nearest neighbour. When looking closely three additional small maxima can be discovered for the liquid phase which must correspond to some kind of ordered structure in the close environment of the particle. This indicates that the liquid phase is still slightly more ordered than the vapour phase. It has also to be noted that the RDF is zero below a distance of one due to an unrealistic overlap of particles.&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid state correspond to the three closest neighbours in the fcc crystal structure, which are at distance &amp;lt;math&amp;gt; \frac{\sqrt{2}}{2}a,\ a&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt; \frac{\sqrt{6}}{2}a&amp;lt;/math&amp;gt;. The lattice parameter a can be evaluate from the density of 1.2 using the equation of a previous section and yields 1.49. Substituting for a gives to those three distances &amp;lt;math&amp;gt; r_ 1= 1.06&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_2= 1.49&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; r_3= 1.83&amp;lt;/math&amp;gt;, which vaguely correspond to the maxima of the RDF graph (~2-3% error). The coordination number of those three peaks can be found using the integral graph and relating each distance to a corresponding integral value. For &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; this equals rounded to 12, for &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt; this is 6 and for &amp;lt;math&amp;gt;r_3&amp;lt;/math&amp;gt; this is 24.&lt;br /&gt;
&lt;br /&gt;
[[File: RDFMAS.png |thumb|centre|400px|Figure 11: RDF of the three phases|none]] &lt;br /&gt;
[[File:INRDFMAS.png|thumb|centre|400px|Figure 12: Integral of the RDF of the three phases|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The radial distribution function is not limited to electron density, there is no electron density in your simulations, just classical particles.  The solid phase has long range order whereas the liquid phase has sort range order, but no long range order.  Good idea to express all of the first 3 peaks in terms of the lattice parameter, but would have been good to have used these expression to calculate the lattice parameter from the first 3 peaks and then compare this with the initial value, rather than the opposite way round.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Dynamical properties and the diffusion coefficient=&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; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need 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 simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was calculated using &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;. The calculated diffusion coefficients from the respective gradients of the graph trendiness are summarised below for the whole section.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Diffusion Coefficient (Area/Time)&lt;br /&gt;
!MSD&lt;br /&gt;
!MSD (Million atoms)&lt;br /&gt;
! VCAF&lt;br /&gt;
! VCAF (Million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;3.19&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;2.38&#039;&#039;&#039;	&lt;br /&gt;
| &#039;&#039;&#039;3.42&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;3.16&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0700&#039;&#039;&#039;	 &lt;br /&gt;
| &#039;&#039;&#039;0.0708&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0699&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0896&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;6.00E-6&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;4.43E-6&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;1.79E-4&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;4.83E-5&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Increasing the number of atoms for the simulation only deviated the diffusion coefficient slightly but could lead to more accurate results due to a higher resolution of data. Furthermore, a clear trend in the size of the diffusion coefficient is visible as it increases drastically between the phases of liquid and gases. This is due to sudden increase in degrees of freedom a gas has in comparison to a liquid or solid (most ordered). The diffusion coefficients for liquid is also quite a bit larger than for a solid for the same reason.&lt;br /&gt;
&lt;br /&gt;
The MSD graphs showed unsurprisingly that the MSD for vapour increased almost exponentially due to its high mobility and freedom. In the close up the MSD of the solid phase increases very quickly to a low equilibrium value and stays there quite constrained due to its high ordered nature. The MSD of the liquid phase seems to increase slowly and linearly over time. Running the simulation with more atoms decreased the rate at which the MSD for the vapour phase increased. This is due to the fact that the atoms have more collision partners available and thus an extra &amp;quot;constraint&amp;quot;. By increasing the number of atoms infinitely the slope will approximate first that of a liquid and later of a solid (as the density increases and increases).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit on the graphs, did you fit to the entire data range or just to the linear part?  The vapour phase MSD begins as a quadratic curve which represents ballistic motion, before collisions occur and the diffusive regime is reached.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: NEWMSQDISEASY.png |thumb|centre|400px|Figure 13: MSD for the small simulation|none]] &lt;br /&gt;
[[File: NEWMSQDISCOMPLEX.png |thumb|centre|400px|Figure 14: MSD for the million atom simulation|none]] &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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Evaluating the normalised velocity autocorrelation function&lt;br /&gt;
!Comments&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;
|Given &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; the derivative with respect to time is &amp;lt;math&amp;gt; v\left(t\right) = -\omega A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; and can be substituted in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \omega A\sin\left(\omega t + \phi\right) \times \omega A\sin\left(\omega (t + \tau) + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \omega^{2} A^{2}\sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
| Factorising the constants and using the trigonometric identity &amp;lt;math&amp;gt;\sin\left(\omega t +\omega \tau + \phi\right) = \sin\left(\omega t + \phi \right)\cos\left(\omega \tau\right) + \sin\left(\omega \tau \right)\cos\left(\omega t + \phi \right)&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) \times [\sin\left(\omega t + \phi \right)\cos\left(\omega \tau\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}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Factorising the square brackets and using the fact that t is independent of &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; to take some components out of the integral.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^{2}\left(\omega t + \phi\right)\mathrm{d}t + \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;
|The integrals in the first term cancel out.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega \tau\right) + \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;
|The second term equals to zero due to nature of the parity of the functions under the integral. As it consists of a sine function (odd) and a cosine function (even) the product of both is always an odd function which has the property of havinthere is more time between collisions and so it takes longer forg a zero integral from -infinity to infinity.&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;
|Hence shown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF are related to the minima in the RDF from the previous section. They have to do with the interactions of particles in their respective phase as every interaction influences the velocity of the particles. For the liquid there is a relatively high rate of collision which causes a rapid decrease in the oscillation and so the VACF goes to zero very rapidly. Contrary, a solid which has spacial constrains imposed will slowly find its uncorrelated state. This is seen by the relative large fluctuations over time in comparison to the liquid. The harmonic oscillator does not include any collisions so that the VACF for it will remain constant forever. The reason it is defined by a cosine function rather than a straight line is that its displacement around the equilibrium distance has harmonic behaviour (and thus all the properties related to it do too, i.e. velocity, force, etc.). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you be a bit more specific, what happens when the VACF become negative?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: AUTOCORRELMAS.png |thumb|centre|400px|Figure 15: Autocorrelation Function|none]] &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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are listed in the table of the above section and are slightly larger than the ones obtained using MSD, which was unexpected. However, the largest error using the VACF method originates from using the trapezium rule. Rather than taking the exact integral it is approximated by a sum of rectangles with finite width. In this report they were calculated using the outside triangles thus making the integral seem bigger than it is. This would be one explanation for the deviation to the MSD method. The diffusion coefficient trends described earlier are still observed. &lt;br /&gt;
&lt;br /&gt;
[[File: RUNNININTEGEASY.png |thumb|centre|400px|Figure 16: VACF for the small simulation|none]] &lt;br /&gt;
[[File: RUNNININTCOMPLE.png |thumb|centre|400px|Figure 17: VACF for the million atom simulation|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Change the y axis scale to show the full running integral for the vapour phase, calculating the diffusion coefficient from the VACF relies on the running integral reaching a plateau in the simulation time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
This lab used LAMMPS to model and calculate structural and (thermo)dynamic properties of atom ensembles. It investigated the influence of outside parameters (temperature, pressure) on the system and showed the importance of the time step vs data accuracy trade off. Further investigations into the RDF and the diffusion coefficient of the ensembles revealed some interesting and well-known properties about how the interaction and order of a structure is reflected in those parameters. It also demonstrated the use of different methods to calculate the diffusion coefficient and showed the importance of understanding the underlying methods in order to evaluate which results are more suitable.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:pp2814LD&amp;diff=591815</id>
		<title>Talk:Mod:pp2814LD</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:pp2814LD&amp;diff=591815"/>
		<updated>2017-03-01T04:00:20Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All task answered and results look good, but some of your written answers are quite unclear.  Try to make your explanations of...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All task answered and results look good, but some of your written answers are quite unclear.  Try to make your explanations of your results more focused and concise and make sure you understand the background theory behind each task.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Liquid Dynamics Computational Project:=&lt;br /&gt;
&lt;br /&gt;
==Introduction to Molecular Dynamics Simulation:==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is the excel file with all of the columns filled in as needed.&lt;br /&gt;
&lt;br /&gt;
[[Media:Pp2814_HO.xls]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2813_Increase_error.png|800px]]&lt;br /&gt;
&lt;br /&gt;
It is interesting to note that the total error increases linearly with time, indicating that the errors from previous loops of the verlet algorithm are carried forward with each cycle. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why does the error oscillate though?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here you can see the graph of energy that varies by no more than 1%. This is achieved by a timestep of 0.2. It is important to keep track of physical properties of the system to make sure that the numerical modelling is doing it&#039;s job correctly, and that the model is a good approximation of the real physical system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  In particular the principle of conservation of energy implies that energy should be constant, so we need to check this is approximately the case.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_5%energy.png|800px]] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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, \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;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The separation bond length at &amp;lt;math&amp;gt; \phi(r) = 0 &amp;lt;/math&amp;gt; is simply &amp;lt;math&amp;gt; r_o = \sigma&amp;lt;/math&amp;gt;, as when the two are equal, &amp;lt;math&amp;gt; \frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6} = 0 &amp;lt;/math&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
The equilibrium bond length is &amp;lt;math&amp;gt;2^{1/6} \sigma = r_{eq}&amp;lt;/math&amp;gt; from:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0=-4\epsilon (\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;
&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;
&amp;lt;math&amp;gt; \frac{2\sigma^{12}}{\sigma^6} = \frac{r_{eq}^{13}}{r_{eq}^7} &amp;lt;/math&amp;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;
Well Depth at &amp;lt;math&amp;gt;r_{eq} &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{(2^{1/6}\sigma)^{12}} - \frac{\sigma^6}{(2^{1/6}\sigma)^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2 \sigma^{12}} - \frac{\sigma^6}{2 \sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2}^\infty 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = 4 \left [ \frac{1}{5 r^5} - \frac{1}{11r^{11}} \right]_{2}^{\infty} = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = 4 \left [ \frac{1}{5 r^5} - \frac{1}{11r^{11}} \right]_{2.5}^{\infty} = -0.00817 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = 4 \left [ \frac{1}{5 r^5} - \frac{1}{11r^{11}} \right]_{3}^{\infty} = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3.34 * 10^{22}&amp;lt;/math&amp;gt; molecules in 1 mL water. This is knowing that the density of water is 1 g/cm^3, and that 1mL - 1cm^3. Therefore the number of moles is 1/18 = 0.05 mol. Multiply that by avagadro&#039;s number and you get the answer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;3 * 10^-{19}&amp;lt;/math&amp;gt; mL water contains 10 000  molecules, from &amp;lt;math&amp;gt;18* \frac{100 000}{6.023 * 10^{-23}}&amp;lt;/math&amp;gt; for the number of grams, which is equal to the number of mL.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but show your working more clearly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position \left(0.5, 0.5, 0.5\right) 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;. At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions are applied. the molecule is at (0.2, 0.1, 0.7)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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; If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r* in real units is 1.088 nm from &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well depth is &amp;lt;math&amp;gt;- \epsilon &amp;lt;/math&amp;gt;. So the well depth is &amp;lt;math&amp;gt;-1.66 * 10^{-24} kJ mol^{-1}&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;\epsilon = -120 k_B &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
T*= 180K in non-reduced units from &amp;lt;math&amp;gt;T= \frac{\epsilon T^*}{k_B} = 120  T^*&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You need to multiply the well depth by Avagadro&#039;s number to get it in mol-1.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration:==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are very close together, the repulsive interactions of the potential dominate. If they are too close together, they will repel each other with forces that would not happen in nature. Also, it might also prevent the simulation from working in the first place, if such great repulsions are present, messing up calculations.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A number density of 0.8 can be obtained by plugging in values into &amp;lt;math&amp;gt; \frac{N}{V} &amp;lt;/math&amp;gt;. For the simple cubic lattice with one atom per unit cell this is &amp;lt;math&amp;gt;\frac{1}{1.07722^3}&amp;lt;/math&amp;gt; which indeed equals 0.8. For an fcc lattice, with 4 atoms per unit cell, we get &amp;lt;math&amp;gt;(\frac{4}{1.2} )^{1/3}&amp;lt;/math&amp;gt; from rearranging the previous formula. This yields a lattice parameter of 1.49 for the fcc lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If 1000 atoms are created for the simple cubic lattice with one atom per unit cell, 4000 atoms would be created for the fcc lattice as there are 4 atoms per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The comment essentially sets the mass for the atoms, and the pairwise potential interactions between the atoms, setting the cutoff at which the interactions exist. Beyond the radius of that cutoff, there will be no interactions between atoms. The pair-coeff part simply applies coefficient to different types of atoms (none here, so both =1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific, what are the pair coefficients in this case, for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We use the velocity-verlet algorithm with those starting parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The lines put the timestep into a variable which can be used later to calculate properties. If the bottom version is used, then the timestep is not saved into a variable, the system runs and never outputs any timestep. A lot of calculations would therefore not be feasible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Not quite, both versions will run in exactly the same way.  The advantage of using a variable is that if the value of it is changed, all commands which depend on that property are changed automatically, here the number of steps to run the simulation for.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_001_timeEnergy.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
In the graph above, where the total energy vs time is plotted for the simulation with the timestep of 0.001, it can be clearly seen that an equilibrium is reached at relatively low times. This can be seen by the fact that a constant energy is reached, around which the system oscillates. If one then looks at how the total energy varies with differing timestep, the following plot results. &lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_EnergyTimestep.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
This plot shows that the worst timestep to use is indeed 0.015, as the total energy does not reach a constant value- it diverges rather than converging. This definitely does not represent physical reality. 0.0075 and 0.01 are decent approximations, but the larger timestep leads to a higher total energy value, meaning that while the system is moderately representative of the physical system, it is not entirely accurate. The highest timestep that still gives results that as are good as 0.001 is actually 0.0025, which comes to the same, or very similar total energy as the timestep 0.001.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but why would you choose 0.0025 over 0.001?  Better to choose the largest accurate timestep so that the simulations cover more time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running Simulations under Specific Conditions:==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature T^* = 1.5), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen \left(p, T\right) points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The temperatures used were 1.5, 1.7, 1.9, 2.1, and 2.3, while the pressures used were 2 and 3. &lt;br /&gt;
&lt;br /&gt;
There were two timesteps I considered using for the simulation. 0.001 was obviously the most accurate, though 0.0025 was very similar. In the end, I decided that I would run the more accurate simulation, however if I were to run much longer simulations, I would go for the 0.0025 timestep to save more time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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:&#039;&#039;&#039;&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;&lt;br /&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;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&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{\frac{1}{2}\sum_i m_i (\gamma v_i)^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\gamma^2 \frac{1}{2}\sum_i m_i v_i^2}{\frac{1}{2}\sum_i m_i v_i^2} = \frac{\frac{3}{2} N k_B \mathfrak{T}}{\frac{3}{2} N k_B T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt(\mathfrak{T}/T) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Every 100 timesteps the temperature will be sampled for the average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
100 000 steps will be simulated which is 10000 * timestep = time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give a bit more detail.  100000 in this command is not necessarily the number of steps to be simulated.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to put ideal gas curves on the graph, the ideal gas equation has to be rearranged then converted into reduced units. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{P}{k_BT}= \frac{N}{V}=\rho &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here P, T, and &amp;lt;math&amp;gt; \rho &amp;lt;/math&amp;gt; both have to be converted into P*, T*,  and &amp;lt;math&amp;gt; \rho^* &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T^* = \frac{k_B T}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P^* = \frac{\sum E^*}{\sum V^*} =\frac{\frac{E}{\epsilon}}{(\frac{r}{\sigma})^3}  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; P^* = \frac {E}{V} \frac{\sigma^3}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho^* = \frac{P^*}{T^*} = \frac{P^*}{\sigma^3 T^*} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You don&#039;t need the factor of 1/sigma^3 in the equation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From here, the values for pressure and temperature in reduced units are fed into the equation, and the density in reduced units is produced. These curves can be seen on the graph below, on the same plot as the simulation density/temperature variation. &lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_dens_temp.png|800px|center]]&lt;br /&gt;
&lt;br /&gt;
At lower temperatures the discrepancy is larger, though the errors of the points at lower temperatures are smaller, presumably due to less thermal motion. to the fact that at lower tem Density of the ideal gas equivalent is higher because it does not take into account any interactions or repulsion so the particles can come much closer to each other and stay close. Since there is a set starting lattice for the simulations, the density is related to this starting setup. If there are no repulsive forces they can stay close to each other, even when moving more rapidly. . Physically it makes that the density decreases with temperature, due to the concept of thermal expansion, and what we intuitively know about liquids. (We are going to ignore the case of water- this simulation does not take into account the weird and wonderful world of water, this is a simple liquid after all). In both cases the density is decreasing due to increasing entropy of the system, and with greater entropy the system will want to occupy more space, and hence lower the density. Another cause for the discrepancy at low T is that the expression used for density, derived from the ideal gas equation, has T in the denominator. Therefore as T approaches zero, the density will tend to infinity. WIth the Lennard-Jones liquid, however, there is the repulsive term that prevents the atoms from getting too close, and keeping the density relatively low.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but try to make your explanation clearer.  How does the discrepancy between ideal gas and simulation results change with pressure?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacities==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The heat capacities from the file output are given by &amp;lt;math&amp;gt; C_V^* = N^2 * \frac{var[E^*]}{(T^*)^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
In order to get the heat capacity per unit volume, the value of heat capacity that is output by the simulation must be multiplied by &amp;lt;math&amp;gt; \frac{\rho^*}{N} &amp;lt;/math&amp;gt;, where N is 3374 atoms. &lt;br /&gt;
The results are plotted in the chart below. &lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_CV_var.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
Here you can see that heat capacity is decreasing with temperature. Going from basic thermodynamic principles &amp;lt;math&amp;gt; C_v = \frac{dQ}{dT} &amp;lt;/math&amp;gt;. Assuming that Q is independent of T, we would get a constant value for the heat capacity, one that does not depend on temperature. However, there is a clear variation of heat capacity with temperature, as it decreases with increasing temperature. This could be considered an example of a &#039;&#039;&#039;Schottky anomaly&#039;&#039;&#039;, where the heat capacity decreases after it reaches a peak at low energies. This is indicative of a system with two energy levels that have an energy spacing similar to that of low temperatures, and once the temperature increases past that of the energy separation of the states, the heat capacity decreases as the levels are equally occupied, and an increase in temperature has little to no impact on the entropy. As the heat capacity is related to the entropy through temperature, (&amp;lt;math&amp;gt;{\displaystyle S=\int _{0}^{T}\!\left({\frac {C_{v}}{T}}\right)dT\,}&amp;lt;/math&amp;gt;) this results in a decrease in the heat capacity. &lt;br /&gt;
&lt;br /&gt;
Example input file [[Media:pp28140.8NVT2.4.in|here]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good ideas for explaining the trend with temperature, but remember that these simulations are classical and so there are no discrete energy levels and instead there is a continuous distribution of states.  What about the trend in heat capacity with density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate g(r) and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_RDF.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid RDF correspond to the three nearest neighbors, which can be see in the image adjacent. The first peak should represent &amp;lt;math&amp;gt;  \frac{a}{\sqrt2} &amp;lt;/math&amp;gt; where a is the lattice parameter. For the solid state, the lattice parameter is 1.493 (taken from the output file). Plugging this into the previous formula, this says that the nearest neighbor should be at r=1.05. Indeed, the first peak for the solid RDF is at just over 1. Only 1.025 rather than 1.05, but then again there is vibrational energy in the lattice, which is why the peaks are broad rather than essentially delta functions. The next nearest neighbor should be at &amp;lt;math&amp;gt;r=a&amp;lt;/math&amp;gt;. Once again, this is indeed the case, as the second peak is at 1.475 (close to 1.493!). The third peak should be at 1.828 (&amp;lt;math&amp;gt; \sqrt{\frac{3}{2}} a &amp;lt;/math&amp;gt;), and indeed the third peak is at r=1.825. So the RDF very clearly and accurately shows the lattice parameter and the nearest neighbors in r.&lt;br /&gt;
&lt;br /&gt;
[[File:NearestSitesPP2814.png|thumb|right|Circled is the reference point. Orange is the nearest neighbor, green the next-nearest, and red the third-nearest]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see on the graph, there are three very distinct RDFs, one for each phase. The RDF for the gas phase shows a single peak at just over 1, that decays with little to no fluctuation quite quickly. Liquid peaks slightly earlier and has far more fluctuations, which are more fluid than the fluctuations of solid. The solid RDF has much more choppy peaks that are also at slightly lower r. This is because the location of the next nearest neighbors are much more well-defined, at a better-defined value of r in solids. With liquid the curves are broader due to the lack of long-range order- they look more like the curves you would see for the radial distribution function of an atomic orbital. The breadth of the curve says that there is probably a liquid molecule in that range of r. Since a gas is so disperse there are no peaks.&lt;br /&gt;
&lt;br /&gt;
The coordination number of the first three peaks for the solid RDF can be found by looking at the data from the running integral, as the area under g(&#039;&#039;r&#039;&#039;) represents the number of nearest neighbors, as g(&#039;&#039;r&#039;&#039;) is a function of density in space. The coordination number for the nearest neighbor is 12, which can be seen from the running integral value of 12.01. The next peak has an integral of 6 (18.4-12.01), while the final peak has the integration value of 24 again (23.86, 42.26-18.4). When picturing the crystal lattice, this makes geometrical sense. So the coordination number of the first peak is 12, for the second peak it&#039;s 6, and for the third it&#039;s 24. The data was taken from the files output by the VMD.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good idea to compare each of the first 3 peaks to the lattice parameter value used as an input to the simulation, but might be more useful to extract the lattice parameter from the first 3 peaks and calculate the average to then compare with the input value.  Show the running integral of the RDF.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2114_msd_totNEW.png|800px|center]]&lt;br /&gt;
&lt;br /&gt;
Above is the general MSD plot, which shows very clearly that the slopes of the MSD plots vary immensely from one phase to the next. Below are the separate plots for the MSD for each phase, and for my simulation and the million-atoms simulation. They are quite similar, however the solid million-atom simulation is a bit smoother. This is probably because the thermal motion of all of the atoms tend to cancel each other out in larger values, as is central in statistical thermodynamics (ergodicity). If you enlarge the images, you can see the lines of best fit used to calculate the diffusion coefficient. Note that for the gas phase, a line of best fit is only fitted to the linear portion of the graph, and took the line of best fit for that. I included the other line of best fit and Rsquared values to show which line of best fit had a better fit. The line of best fit is important for the averaged part of the mean squared deviation. &lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_gasMSD.png|500px]]&lt;br /&gt;
[[File:Mill_MSD_pp2814_gas.png|500px]]&lt;br /&gt;
[[File:Pp2814_liqMSD.png|500px|]]&lt;br /&gt;
[[File:Mill_MSD_pp2814_liq.png|500px]]&lt;br /&gt;
[[File:Pp2814_solMSD.png|500px]]&lt;br /&gt;
[[File:Mill_MSD_pp2814_sol.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since all of the values have the same arbitrary units, there does not need to be any kind of unit manipulation, and the values can simply be compared. &lt;br /&gt;
&lt;br /&gt;
Using &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;, I got the following values for &#039;&#039;D&#039;&#039; from the gradient of the line once a visible equilibrium had roughly been met:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&#039;&#039;&#039;Simulation&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Million&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Gas&#039;&#039;&#039; &lt;br /&gt;
|  0.0043     &lt;br /&gt;
| 0.00603   &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Liquid&#039;&#039;&#039; &lt;br /&gt;
| 0.00016     &lt;br /&gt;
| 0.00016   &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Solid&#039;&#039;&#039; &lt;br /&gt;
| &amp;lt;math&amp;gt;1x10^{-8}&amp;lt;/math&amp;gt; &lt;br /&gt;
| &amp;lt;math&amp;gt;8.3x10^{-9}&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These values make sense logically. Gases and liquids are subject to thermal motion, and we know intuitively that they diffuse- otherwise a lot of our chemistry would be limited. This means that they will have non-zero values for &#039;&#039;D&#039;&#039;, which is what we observe. Since solids are locked into their lattices, they will not exhibit any diffusion. The values for &#039;&#039;D&#039;&#039; we get here for the solids are definitely very very close to 0. In fact, the reason why it is non-zero is probably that the first section of the graph, where it was still equilibrating, was included, as well as the general fluctuations due to thermal motion. In a real crystal, the diffusion coefficient would be non-zero, due to defects in the crystal that can diffuse (slowly!) through the lattice. A gas has a higher diffusion constant than a liquid as the particles are much further apart and can move freely without any major interactions, and can therefore diffuse through space more easily. Due to the proximity of other particles in the liquid phase that interact more strongly, liquids have lower diffusion. Entropically this also makes sense; phases with higher entropy will diffuse more rapidly due to the greater number of accessible microstates of a diffuse phase.&lt;br /&gt;
&lt;br /&gt;
The fact that the million-atoms simulations are not hugely different to the smaller simulations indicates that it is possible to compute smaller systems and apply results to larger systems as needed to save computational power and time. The values for the diffusion coefficients are a bit more extreme for the million-atom simulation, highlighting their differences a bit more, but only minorly. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why didn&#039;t you ignore the first few data points when fitting a straight line to the solid data?  Why does gas MSD increase quadratically initially (ballistic motion)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v(t)v(t + \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&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 C\left(\tau\right) with \omega = 1/2\pi and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \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;
&amp;lt;math&amp;gt; x(t)= A \cos{(\omega t + \phi)}  &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = -A\omega \sin{(\omega t + \phi})  &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega \sin{(\omega(t+\tau) + \phi)} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; &lt;br /&gt;
C(\tau) = \frac{\int_{-\infty}^{\infty} -A\omega \sin(\omega t + \phi) * -A\omega \sin(\omega (t+\tau) + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty}(-A\omega)^2 \sin^2 (\omega t + \phi)\mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  C(\tau) = \frac{(A\omega)^2 \int_{-\infty}^{\infty} \sin (\omega t + \phi) \sin (\omega \tau + \phi) \mathrm{d}t}{(A \omega)^2 \int_{-\infty}^{\infty} sin^2 (\omega t + \phi) \mathrm{d}t} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next we set &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\alpha = \omega t , \beta = \omega \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin (\alpha) \sin (\alpha + \beta)\mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next step is to use the trig identity &amp;lt;math&amp;gt;\sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta&amp;lt;/math&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} \sin^2 \alpha \cos \beta + \sin \alpha \cos \alpha \sin \beta \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin^2 \alpha \cos \beta \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha} + \frac{\int_{-\infty}^{\infty} \ \sin \alpha \cos \alpha \sin \beta \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \cos \beta +  \frac{ \sin \beta \int_{-\infty}^{\infty} \ \sin \alpha \cos \alpha \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use the trig identity &amp;lt;math&amp;gt;\frac{1}{2} \sin x\cos x = \sin (2x)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\cos \beta \int_{-\infty}^{\infty} \sin^2 \alpha \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha} ) + \frac{2\sin \beta \int_{-\infty}^{\infty} \ \sin (2\alpha)  \mathrm{d}\alpha}{\int_{-\infty}^{\infty} \sin^2 (\alpha)\mathrm{d}\alpha} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the second term falls away due to the odd nature of &amp;lt;math&amp;gt;\sin (2 \alpha)&amp;lt;/math&amp;gt;, rendering it&#039;s integral equal to zero. (If you look at it theoretically, the integral diverges). The integral of sin^2 alpha cancels out in the first term, leaving the velocity autocorrelation function as &amp;lt;math&amp;gt; C(\tau) = \cos (\beta) = \cos (\omega \tau) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean by &amp;quot;the integral diverges theoretically&amp;quot;?  If the integral diverges then it isn&#039;t zero, however this integral is zero because it is the integral of an odd function with limits which are symmetric about zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_VACF.png|1000px|center]]&lt;br /&gt;
&lt;br /&gt;
Clearly there is a difference between the solution for the harmonic oscillator VACF and the Lennard-Jones potential used for the simulations. Most notable is the fact that the VACF starts much higher, and falls away quite quickly. The liquid VACF also doesn&#039;t even undergo a full oscillation, but dies down quite quickly after a broad peak. The solid VACF has more evident but damped oscillations due to more rigid long-range order. Since the positions of atoms are better-defined, the oscillations are more similar to the harmonic oscillator than the liquid. The damping of the &amp;quot;oscillations&amp;quot; of the solid and liquid are due to collisions and interactions between particles. The harmonic oscillator approximation only holds if there are no collisions or only around the absolute equilibrium of the system, which is definitely not the case. Also the Lennard Jones potential is anharmonic, so as things interact and move around, that anharmonicity will cause a change. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific, what change will the anharmonicity of the Lennard-Jones potential cause and what do the minima in the VACF represent physically?  There are no collisions in the harmonic oscillator VACF so it never decays.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Pp2814_liq_vcaf.png|600px]]&lt;br /&gt;
[[File:Pp2814_mil_liq_vcafNEW.png|600px]]&lt;br /&gt;
[[File:Pp2814_sol_vcaf.png|600px]]&lt;br /&gt;
[[File:Pp2814_mil_sol_vcaf.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Using the final running integral value for each TrapIntegration plot, I calculated the following values for &#039;&#039;D&#039;&#039; using &amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&#039;&#039;&#039;Simulation&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;Million&#039;&#039;&#039;   &lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Liquid&#039;&#039;&#039; &lt;br /&gt;
| 48.9444   &lt;br /&gt;
| 45.0457   &lt;br /&gt;
|- &lt;br /&gt;
| &#039;&#039;&#039;Solid&#039;&#039;&#039; &lt;br /&gt;
| 0.09405&lt;br /&gt;
| 0.02276&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are rather noticeably different to the values achieved from the MSD above, though the same general pattern holds: the liquid simulation has a much much higher value for the diffusion coefficient than the solid. The gas graphs were not included (because they were not requested) due to the fact that in the timespan of the simulation, the gas never reached a plateau, the graph of the running integral was more of a gentle curve upwards, slope decreasing but definitely not plateauing in the timeframe of the simulation. This is probably due to the highly diffuse nature of gases compared to liquids and solids. &lt;br /&gt;
&lt;br /&gt;
The limitations of the VACF lie in the fact that it assumes that the velocity remains the same regardless of collision, while in reality, collisions frequently change the velocity of particles. This may be why the values are so different to the values from the mean square deviation method of calculation. Another major error of this method is the fact that it uses the trapezium rule, a rather crude approximation, to find the numerical integral of the VACF. Also, as the timesteps are given as 1,2,3,.. etc, there is no opportunity for the value of h, or the width of the trapezium, to be reduced further, which would allow for a more accurate calculation. Perhaps using the actual value of time rather than timestep would allow for more precise measurement, though that would bring units into the fray.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The VACF does not assume that velocity remains the same, the velocity of each particle is dependent on time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:APPLEBANANAKIWI&amp;diff=591814</id>
		<title>Talk:Mod:APPLEBANANAKIWI</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:APPLEBANANAKIWI&amp;diff=591814"/>
		<updated>2017-03-01T01:38:39Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report, .&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  =Introduction=  &amp;#039;&amp;#039;&amp;#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is us...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Good report, .&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below in Figure 1 is the graph for the displacement &amp;lt;math&amp;gt;x\left(t\right)&amp;lt;/math&amp;gt; calculated using firstly the Verlet algorithm and secondly the analytical solution using the classical harmonic oscillator. Latter reduces down to &amp;lt;math&amp;gt; x\left(t\right) = \cos\left(t\right)&amp;lt;/math&amp;gt; as all the parameters are set to either zero or one. From the direct comparison on this relatively low resolution graph no significant deviation is observed. &lt;br /&gt;
In Figure 2 the total energy versus time is shown at a time step of 0.1. The total energy was calculated as a sum of kinetic and potential energies and given in reduced form (as both the force constant k as well as the mass equals to one): &amp;lt;math&amp;gt;E_T = \frac{1}{2} \left(v^{2}+x^{2}\right)&amp;lt;/math&amp;gt;. This expression originates from the kinetic energy expression &amp;lt;math&amp;gt;E_K= \frac{1}{2}m v^{2}&amp;lt;/math&amp;gt; and the potential energy expression &amp;lt;math&amp;gt;E_P= \frac{1}{2}k x^{2}&amp;lt;/math&amp;gt; which represents the potential energy gained as a function of displacement from the equilibrium distance.&lt;br /&gt;
&lt;br /&gt;
[[File:DisplacementMAS.png|thumb|centre|500px|Figure 1: Displacement|none]] &lt;br /&gt;
[[File:TOTEnergyMAS.png|thumb|centre|500px|Figure 2: Total Energy|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The error between the Verlet algorithm and the classical harmonic oscillator seems to increase with time according to the equation in the diagram. It has to be noted that the error has a local maxima every time the displacement reaches zero and a local minima every time the displacement is at a turning point.&lt;br /&gt;
&lt;br /&gt;
[[File: ERROR0.1MAS.png |thumb|centre|500px|Figure 3: Error|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A wide range of time steps were used ranging from &amp;lt;math&amp;gt;t = 0.01&amp;lt;/math&amp;gt; up to &amp;lt;math&amp;gt;t = 0.5&amp;lt;/math&amp;gt;. The table below represent the maximum error found in the simulations. As expected the error increased with higher time steps while it decreased with smaller time steps. The threshold of decreasing the error below 1% (0.01 in absolute values) of the displacement seemed to be just around &amp;lt;math&amp;gt;t = 0.2&amp;lt;/math&amp;gt;. It has to be noted that the percentage error of displacement will be proportionate to the percentage error in total energy as former is used to calculate the latter. Any calculation with a time step lower than 0.2 would therefore yield a sufficiently accurate result. However, it has to be noted that by decreasing the time step the length of the simulation decreases as well. In order to evaluate the same amount of steps one would have to run the calculation longer. It essentially comes down to a trade-off between computational duration and accuracy of results.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Timestep&lt;br /&gt;
!Error in Displacement (absolute values)&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.000006&lt;br /&gt;
|-&lt;br /&gt;
|0.05&lt;br /&gt;
|0.0005&lt;br /&gt;
|-&lt;br /&gt;
|0.075&lt;br /&gt;
|0.002&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|0.2&lt;br /&gt;
|0.09&lt;br /&gt;
|-&lt;br /&gt;
|0.5&lt;br /&gt;
|0.7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, but why is it important to check that total energy doesn&#039;t fluctuate too much?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|For a single interaction the Lennard-Jones potential is shown. It consists of the combination of the repulsive part which dominates at small distances and the attractive term which dominates at larger distances. Here it is set to zero to find &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|In order for the function to equal zero either the inside of the brackets has to equal to zero (or the constant &amp;lt;math&amp;gt;\epsilon = 0&amp;lt;/math&amp;gt;).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sigma^6}{r^6} \left( \frac{\sigma^6}{r^6} - 1 \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|Factorising and realising that the expression inside the brackets has to equal to zero (or the constant &amp;lt;math&amp;gt;\sigma = 0&amp;lt;/math&amp;gt;). &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{\sigma^6}{r^6} = 1&amp;lt;/math&amp;gt;&lt;br /&gt;
|rearranging and taking the sixth root leads to the next line&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r_0 =\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|Alternatively, when &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; approaches infinity would also yield the potential to approach zero.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;\mathbf{F}_i &amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The force at this separation is given by the derivative of the potential with respect to the distance. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|This is the expression for that one interaction described in the previous example. Setting &amp;lt;math&amp;gt;r =\sigma&amp;lt;/math&amp;gt; and rearranging leads to the next line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\mathbf{F}_i = \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The force thus depends on both the depth of the potential well as well as the distance &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; (which is essentially &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;- \mathbf{F}_i = - 4\epsilon \left(\frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|In order to find the equilibrium distance the derivative of the potential (negative force) has to be set to zero in order to find that minima. Using the same reasoning as in the above example, the expression inside the brackets should equal to zero.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \frac{6\sigma^6}{r^7} \left( \frac{2\sigma^6}{r^6} - 1 \right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
|Using the expression of the inside of the brackets and setting it to zero again leads to the final line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r_{eq} =2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
|The equilibrium distance is proportional to the parameter distance &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of the depth of the potential well&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U= 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Substituting the value for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; obtained above into the expression of the potential.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U= 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Simplifying the fractions leads to the final line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;U = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
|The depth of the potential well is proportional to &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, which makes sense as this is the parameter which controls this property.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Evaluation of the total interaction integrals&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{\alpha}^\infty 4 \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
|Setting the parameters to one (as instructed) and changing the lower limit of the integral to &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; allows a general approach.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{\alpha}^\infty \phi\left(r\right)\mathrm{d}r = -4\left( \frac{1}{11r^{11}} - \frac{1}{5r^5} \right) |_{\alpha}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
|This is a standard integration. For the upper bound the integral evaluates to zero, while the lower bound is shown in the next line.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\int_{\alpha}^\infty \phi\left(r\right)\mathrm{d}r = 4\left( \frac{1}{11\alpha^{11}} - \frac{1}{5\alpha^5} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|This expression can now be evaluated for different values of &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; as shown below.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\alpha = 2&amp;lt;/math&amp;gt; gives an integral of &amp;lt;math&amp;gt;-0.0248&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\alpha = 2.5&amp;lt;/math&amp;gt; gives &amp;lt;math&amp;gt;-0.00818&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\alpha = 3&amp;lt;/math&amp;gt; gives &amp;lt;math&amp;gt;-0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
|The integral will become smaller with increasing lower limit and eventually tend to zero. In the physical world this corresponds to the two particles losing all interaction at infinite distance.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well explained.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Estimation of the water molecule properties&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;No_{Molecules} = \frac{6.023 \times 10^{23}}{18} = 3.35 \times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
|1 ml of water corresponds to 1 g at room temperature and pressure. Considering the molar mass of water is approximately 18.015 g/mol, means that the inverse of this number is the amount of matter (in mole) in 1 g. In order to find the number of molecules that inverse has to be multiplied by Avogado&#039;s constant.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;V_{10000 Molecules}= \frac{m}{\rho}  = \frac{10000 \times 18}{6.023 \times 10^{23}} = 2.99 \times 10^{-19} mL&amp;lt;/math&amp;gt;&lt;br /&gt;
|The volume is related to the mass through the density (equal to one at standard conditions). The mass of 10000 molecules obtained by dividing the molar mass by Avogado&#039;s constant to obtain the mass of one molecule and then multiplying it with 10000.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of a position Vector&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\vec{v} = \left(0.5, 0.5, 0.5\right) + \left(0.7, 0.6, 0.2\right) = \left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|Simple vector addition before boundary conditions are applied.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\vec{v} = \left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
|The boundary conditions impose a cutoff in all dimensions at one, which results in following position vector. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Calculation of LJ parameters in real units for argon&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;r = \sigma r*= 1.09 nm&amp;lt;/math&amp;gt;&lt;br /&gt;
|LJ cutoff in real units&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\epsilon = R \times 120 K = 0.998 kJ.mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
|By multiplying with the gas constant one can immediately obtain the well depth.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;T = \frac{\epsilon T*}{k_B}=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
|Temperature in real units.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and working clearly shown.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Equilibration=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This could cause problems as the atoms could be initiated on top of each other, i.e. one atom would be occupying space which shouldn&#039;t be available. Likewise this would lead to a false representation of the interaction as it is unlikely that two atoms would ever get that close to each other (infinitely high potential).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The high repulsive forces caused by overlapping particles would make the simulation unstable and could cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Number density of lattice points&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\rho = \frac{n_{atoms}}{V} = \frac{1}{1.07722^3}=0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
|The number density is given by the number of atoms per unit volume. For a simple cubic lattice with one atom and sides of equal length one can simplify the expression as shown. This leads to the number density of lattice points of 0.8. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;L = \left(\frac{n_{atoms}}{\rho}\right)^\frac{1}{3}=\left(\frac{4}{1.2}\right)^\frac{1}{3}=1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
|Rearranging the equation above leads to a side length of 1.49. It has to be noted that the fcc-lattice contains 4 atoms instead of only 1.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As 1000 unit cells are created with the command four times the amount of atoms are created. Hence 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command refers to the mass assignment of the atoms. The first parameter defines the type of atom (which in our case is always one) and the second command assigns that type a mass (in our case 1.0).&lt;br /&gt;
&lt;br /&gt;
The second command defines the pairwise interaction for the atoms of the system (given by the lj). The cut 3.0 corresponds to the cutoff at a distance of 3.0 (reduced units) as the relevant part of the interaction happens in the region below the cutoff (as shown with the integral calculation in the previous section). This is done to save some computational time. &lt;br /&gt;
&lt;br /&gt;
The third command defines the coefficients of the LJ potential &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; (sets them equal to 1 here). The two stars correspond to the atoms this constrain applies on (stars symbolise it applying to all atoms).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanations.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm given the specified starting parameters.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below. The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The reason the longer code is used is that it automatically calculates and changes the number of steps the simulation has to run when a time step is given as input. In the short code this would have to be done manually. Additionally the use of named variables makes the code more user friendly, easier to follow and easier for subsequent parameter changes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The first three graphs are the plots for pressure, temperature and energy against time for the 0.001 time step in the time region of 0 to 5. This showed to be sufficient even though the simulation run further until 100. However the noise remained constant around the plateaued trend line and was cut off to identify the time it takes for the simulation to reach equilibrium. This was observed to be just below 0.5 and thus happens very fast. After that the values fluctuate around a constant average value for the duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
[[File:PRESSURE0.0001MAS.png|thumb|centre|400px|Figure 4: Pressure|none]] &lt;br /&gt;
[[File:TEMPERATURE0.000MAS1.png|thumb|centre|400px|Figure 5: Temperature|none]]&lt;br /&gt;
[[File:TOTALENERGY0.000MAS1.png|thumb|centre|400px|Figure 6: Total Energy|none]] &lt;br /&gt;
&lt;br /&gt;
The time step that showed the biggest deviation is unsurprisingly the largest time step of 0.015. Both the two lowest time steps 0.001 and 0.0025 seem to have the same average total energy and seem to give similar data quality. Thus it would be sensible to chose the 0.0025 to still give acceptable results as it has a lower computational cost compared to a time step of 0.001. The reason for not choosing a larger time step is the possibility that the system diverges or doesn&#039;t give an accurate representation of the system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, the average total energy shouldn&#039;t depend on the timestep so 0.0075 and 0.01 are not suitable.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: TOTALENERGYALLMAS.png |thumb|centre|400px|Figure 7: Total Energy of all time step systems|none]]&lt;br /&gt;
&lt;br /&gt;
=Running simulations under specific conditions=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A Temperature range of 1.5, 1.7, 1.9, 2.1 and 2.3 was chosen as well as the pressures 2.4 and 2.6.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Finding and expression for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;&lt;br /&gt;
!Comments&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{1}{2}\sum m_iv_i^2=\frac{3}{2}Nk_BT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum m_i(\gamma v_i)^2=\frac{3}{2}Nk_B\mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
|The second equation originates from multiplying the velocity with &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; resulting in a new Temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. Dividing the upper equation by the lower equation leads to the next line. (Note that gamma can be taken outside the summation as it is a constant.)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\frac{1}{\gamma^{2}} = \frac{T}{\mathfrak{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Everything cancels apart from the displayed equation.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;\gamma = \pm\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
| Hence shown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The 100 indicates that every 100th input is sampled and used to calculate the average. The 1000 indicates that there will be 1000 data points used to calculate the average. The 100000 corresponds to the amount of steps after which an average is calculated. So using a time step of 0.0025 and a run of 100000 results in a total simulated time of 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below are the graphs for the densities at pressures 2.4 and 2.6 respectively. The densities seem to decrease with increasing temperatures at both pressures. This is most likely due to the the expansion of the material with increasing temperature that leads to the decrease in density. The values of the two graphs only differ slightly from each other and both simulated densities lie lower than the data obtained through the ideal gas law. This is due to the ideal gas law assuming no interactions between atoms and no excluded volume which allows particles to be in very very close proximity of each other without being repelled. As those factors are present in the simulation it forces the particles at larger distance thus decreasing the overall density in comparison to the ideal gas law. The discrepancy between the two methods increases with pressure as the repulsion increases with higher pressure and thus the gap between ideal gas and simulation increases as well. &lt;br /&gt;
&lt;br /&gt;
[[File:PRESSURE2.4MAS.png|thumb|centre|400px|Figure 8: Density against Temperature at a Pressure of 2.4|none]]&lt;br /&gt;
[[File:PRESSURE2.6MAS.png|thumb|centre|400px|Figure 9: Density against Temperature at a Pressure of 2.6|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct explanation, show all data on a single graph to make it clear that the simulated and ideal gas results are closer at lower pressure.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Calculating heat capacities using statistical physics=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Firstly, the heat capacity per volume decreases with increasing temperature. This has to the do with the density of states of the system. At higher temperature the higher energy states become more populated and thus less energy is required to obtain the same final state so that less heat is absorbed. &lt;br /&gt;
Secondly the heat capacity per volume increases with increasing density. This has to do with the increase in atoms in the system at constant volume. As there are more atoms they require more energy to raise the temperature. &lt;br /&gt;
Thirdly, according to thermodynamic predictions the heat capacity was expected to be a constant independent of temperature (i.e. 1.5 R).&lt;br /&gt;
&lt;br /&gt;
[[File: HEATCAPMAS.png |thumb|centre|500px|Figure 10: Heat capacity per volume vs Temperature|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good suggestions, more analysis would be needed to investigate why the heat capacity has this trend with temperature.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The input script is given below. The main features that were changed from the script of the previous sections are in the #MEASURE SYSTEM STATE# section. New variables were introduced for additional data to be collected. Additionally new properties like the heat capacity and number of atoms were added. The heat capacity per volume was calculated directly through the fact that &amp;lt;math&amp;gt;\frac{C_V}{V} = N \rho\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;. This evaluates the expression directly without having to calculate the volume of the system first. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable sysdens equal 0.2&lt;br /&gt;
lattice sc ${sysdens}&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 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;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp atoms density&lt;br /&gt;
variable n equal atoms&lt;br /&gt;
variable n2 equal atoms*atoms&lt;br /&gt;
variable totenergy equal etotal&lt;br /&gt;
variable totenergy2 equal etotal*etotal&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable dens equal density&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_totenergy v_totenergy2 v_temp v_temp2 v_dens&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable heatcap equal ${n2}*(f_aves[2]-f_aves[1]*f_aves[1])/f_aves[4]&lt;br /&gt;
variable avetemp equal f_aves[3]&lt;br /&gt;
variable avedens equal f_aves[5]&lt;br /&gt;
variable heatcappervol equal ${n}*f_aves[5]*(f_aves[2]-f_aves[1]*f_aves[1])/f_aves[4]&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;Heat Capacity: ${heatcap}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity per Volume: ${heatcappervol}&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Atoms: ${n}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Structural properties and the radial distribution function=&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The radial distribution function gives the electron density as a function of r. It is used to evaluate the order of the system. The RDF for the solid is the most distinct and complex and shows well defined peaks at various distances. This indicates that electron density is particularly high at those distances, probably due to neighbouring particles fixed in space through the solid structure (most ordered system). Both the liquid and the vapour phase have a plateaued line (at 1 - the system density) which indicates that their neighbours are at random distances and not fixed (i.e. constantly in motion). However, they have an initial peak which looks very similar to the inverted LJ potential. The maxima indicates that the electron density is highest in the potential well of the interaction with the nearest neighbour. When looking closely three additional small maxima can be discovered for the liquid phase which must correspond to some kind of ordered structure in the close environment of the particle. This indicates that the liquid phase is still slightly more ordered than the vapour phase. It has also to be noted that the RDF is zero below a distance of one due to an unrealistic overlap of particles.&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid state correspond to the three closest neighbours in the fcc crystal structure, which are at distance &amp;lt;math&amp;gt; \frac{\sqrt{2}}{2}a,\ a&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt; \frac{\sqrt{6}}{2}a&amp;lt;/math&amp;gt;. The lattice parameter a can be evaluate from the density of 1.2 using the equation of a previous section and yields 1.49. Substituting for a gives to those three distances &amp;lt;math&amp;gt; r_ 1= 1.06&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; r_2= 1.49&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; r_3= 1.83&amp;lt;/math&amp;gt;, which vaguely correspond to the maxima of the RDF graph (~2-3% error). The coordination number of those three peaks can be found using the integral graph and relating each distance to a corresponding integral value. For &amp;lt;math&amp;gt;r_1&amp;lt;/math&amp;gt; this equals rounded to 12, for &amp;lt;math&amp;gt;r_2&amp;lt;/math&amp;gt; this is 6 and for &amp;lt;math&amp;gt;r_3&amp;lt;/math&amp;gt; this is 24.&lt;br /&gt;
&lt;br /&gt;
[[File: RDFMAS.png |thumb|centre|400px|Figure 11: RDF of the three phases|none]] &lt;br /&gt;
[[File:INRDFMAS.png|thumb|centre|400px|Figure 12: Integral of the RDF of the three phases|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The radial distribution function is not limited to electron density, there is no electron density in your simulations, just classical particles.  The solid phase has long range order whereas the liquid phase has sort range order, but no long range order.  Good idea to express all of the first 3 peaks in terms of the lattice parameter, but would have been good to have used these expression to calculate the lattice parameter from the first 3 peaks and then compare this with the initial value, rather than the opposite way round.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Dynamical properties and the diffusion coefficient=&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; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need 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 simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was calculated using &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;. The calculated diffusion coefficients from the respective gradients of the graph trendiness are summarised below for the whole section.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Diffusion Coefficient (Area/Time)&lt;br /&gt;
!MSD&lt;br /&gt;
!MSD (Million atoms)&lt;br /&gt;
! VCAF&lt;br /&gt;
! VCAF (Million atoms)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;3.19&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;2.38&#039;&#039;&#039;	&lt;br /&gt;
| &#039;&#039;&#039;3.42&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;3.16&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0700&#039;&#039;&#039;	 &lt;br /&gt;
| &#039;&#039;&#039;0.0708&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0699&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;0.0896&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;6.00E-6&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;4.43E-6&#039;&#039;&#039;&lt;br /&gt;
| &#039;&#039;&#039;1.79E-4&#039;&#039;&#039; &lt;br /&gt;
| &#039;&#039;&#039;4.83E-5&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Increasing the number of atoms for the simulation only deviated the diffusion coefficient slightly but could lead to more accurate results due to a higher resolution of data. Furthermore, a clear trend in the size of the diffusion coefficient is visible as it increases drastically between the phases of liquid and gases. This is due to sudden increase in degrees of freedom a gas has in comparison to a liquid or solid (most ordered). The diffusion coefficients for liquid is also quite a bit larger than for a solid for the same reason.&lt;br /&gt;
&lt;br /&gt;
The MSD graphs showed unsurprisingly that the MSD for vapour increased almost exponentially due to its high mobility and freedom. In the close up the MSD of the solid phase increases very quickly to a low equilibrium value and stays there quite constrained due to its high ordered nature. The MSD of the liquid phase seems to increase slowly and linearly over time. Running the simulation with more atoms decreased the rate at which the MSD for the vapour phase increased. This is due to the fact that the atoms have more collision partners available and thus an extra &amp;quot;constraint&amp;quot;. By increasing the number of atoms infinitely the slope will approximate first that of a liquid and later of a solid (as the density increases and increases).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit on the graphs, did you fit to the entire data range or just to the linear part?  The vapour phase MSD begins as a quadratic curve which represents ballistic motion, before collisions occur and the diffusive regime is reached.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: NEWMSQDISEASY.png |thumb|centre|400px|Figure 13: MSD for the small simulation|none]] &lt;br /&gt;
[[File: NEWMSQDISCOMPLEX.png |thumb|centre|400px|Figure 14: MSD for the million atom simulation|none]] &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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
 {| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Evaluating the normalised velocity autocorrelation function&lt;br /&gt;
!Comments&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;
|Given &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; the derivative with respect to time is &amp;lt;math&amp;gt; v\left(t\right) = -\omega A\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; and can be substituted in&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \omega A\sin\left(\omega t + \phi\right) \times \omega A\sin\left(\omega (t + \tau) + \phi\right) \mathrm{d}t}{\int_{-\infty}^{\infty} \omega^{2} A^{2}\sin^{2}\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
| Factorising the constants and using the trigonometric identity &amp;lt;math&amp;gt;\sin\left(\omega t +\omega \tau + \phi\right) = \sin\left(\omega t + \phi \right)\cos\left(\omega \tau\right) + \sin\left(\omega \tau \right)\cos\left(\omega t + \phi \right)&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) \times [\sin\left(\omega t + \phi \right)\cos\left(\omega \tau\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}&amp;lt;/math&amp;gt;&lt;br /&gt;
|Factorising the square brackets and using the fact that t is independent of &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; to take some components out of the integral.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\cos\left(\omega \tau\right)\int_{-\infty}^{\infty} \sin^{2}\left(\omega t + \phi\right)\mathrm{d}t + \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;
|The integrals in the first term cancel out.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt;C\left(\tau\right) = \cos\left(\omega \tau\right) + \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;
|The second term equals to zero due to nature of the parity of the functions under the integral. As it consists of a sine function (odd) and a cosine function (even) the product of both is always an odd function which has the property of havinthere is more time between collisions and so it takes longer forg a zero integral from -infinity to infinity.&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;
|Hence shown.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF are related to the minima in the RDF from the previous section. They have to do with the interactions of particles in their respective phase as every interaction influences the velocity of the particles. For the liquid there is a relatively high rate of collision which causes a rapid decrease in the oscillation and so the VACF goes to zero very rapidly. Contrary, a solid which has spacial constrains imposed will slowly find its uncorrelated state. This is seen by the relative large fluctuations over time in comparison to the liquid. The harmonic oscillator does not include any collisions so that the VACF for it will remain constant forever. The reason it is defined by a cosine function rather than a straight line is that its displacement around the equilibrium distance has harmonic behaviour (and thus all the properties related to it do too, i.e. velocity, force, etc.). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you be a bit more specific, what happens when the VACF become negative?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File: AUTOCORRELMAS.png |thumb|centre|400px|Figure 15: Autocorrelation Function|none]] &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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are listed in the table of the above section and are slightly larger than the ones obtained using MSD, which was unexpected. However, the largest error using the VACF method originates from using the trapezium rule. Rather than taking the exact integral it is approximated by a sum of rectangles with finite width. In this report they were calculated using the outside triangles thus making the integral seem bigger than it is. This would be one explanation for the deviation to the MSD method. The diffusion coefficient trends described earlier are still observed. &lt;br /&gt;
&lt;br /&gt;
[[File: RUNNININTEGEASY.png |thumb|centre|400px|Figure 16: VACF for the small simulation|none]] &lt;br /&gt;
[[File: RUNNININTCOMPLE.png |thumb|centre|400px|Figure 17: VACF for the million atom simulation|none]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Change the y axis scale to show the full running integral for the vapour phase, calculating the diffusion coefficient from the VACF relies on the running integral reaching a plateau in the simulation time.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
&lt;br /&gt;
This lab used LAMMPS to model and calculate structural and (thermo)dynamic properties of atom ensembles. It investigated the influence of outside parameters (temperature, pressure) on the system and showed the importance of the time step vs data accuracy trade off. Further investigations into the RDF and the diffusion coefficient of the ensembles revealed some interesting and well-known properties about how the interaction and order of a structure is reflected in those parameters. It also demonstrated the use of different methods to calculate the diffusion coefficient and showed the importance of understanding the underlying methods in order to evaluate which results are more suitable.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=591813</id>
		<title>Talk:Mod:wern-liquidsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:wern-liquidsim&amp;diff=591813"/>
		<updated>2017-03-01T01:33:28Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: .&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  = The Simulation of Simple Liquids through Molecular Dynamics = == Theory of Molecular Dynamics == Molecular dyna...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: .&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= The Simulation of Simple Liquids through Molecular Dynamics =&lt;br /&gt;
== Theory of Molecular Dynamics ==&lt;br /&gt;
Molecular dynamics involves simulating how particles in a system move with time, by calculating the relevant velocities, forces and displacements of the particles. In the ergodic hypothesis, whereby the time-average of the system is equivalent to the average of a large number of sampled configurations of the system, molecular dynamics would be able to simulate the time-average part of this hypothesis.&lt;br /&gt;
&lt;br /&gt;
In this experiment, we will use molecular dynamics to simulate a simple liquid governed by Lennard-Jones interactions. The algorithm for calculating the various dynamics of the particles is called the Velocity-Verlet algorithm, and it uses the approximation that the particles obey Newton&#039;s Laws (behave classically).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK : &#039;&#039;&#039;The accuracy of the algorithm was tested by using it to calculate the various dynamics and energies of a simple harmonic oscillator, and comparing it against the exact solutions. &lt;br /&gt;
&lt;br /&gt;
[[Image:errliq10.png|frame|none|Comparison of the displacement functions calculated analytically and by the algorithm.]]&lt;br /&gt;
&lt;br /&gt;
As can be seen, the function calculated by the algorithm (red line) almost has a complete overlap with the analytical function for the SHO displacement (dotted line). This indicates that our algorithm (the Velocity-Verlet) is quite accurate at simulating this system numerically (and at the timestep of 0.1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For the timestep of 0.1, the peaks of the error between the displacement calculated by the algorithm and the exact displacement were seen to rise in height linearly with time, as shown by the plot below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq102.png|frame|none|The upper plot shows the error between the analytical and algorithmic values of the displacement. The lower plot shows that a linear line can be fitted through the heights of the error maxima]]&lt;br /&gt;
&lt;br /&gt;
The equation of the linear fit is shown, and it can be seen that it has a high R&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; value, indicating that the points correlate with a linear fit very well.&lt;br /&gt;
&lt;br /&gt;
The linear fit was made by estimating the position of the error maxima, and the table of the estimates is given below:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
  |Time (estimate)&lt;br /&gt;
  |Error Height&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |2&lt;br /&gt;
  |0.000758457&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |5&lt;br /&gt;
  |0.001999391&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |8&lt;br /&gt;
  |0.00330076&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |11&lt;br /&gt;
  |0.00458839&lt;br /&gt;
&lt;br /&gt;
 |-&lt;br /&gt;
  |14&lt;br /&gt;
  |0.00578735&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
Overall, the fit indicates that as time passes, the discrepancy between the algorithmic and analytical methods would increase. However, the gradient for the change is quite small, whereby each increment of time increases the error by roughly 0.0004. Therefore, even if we were to run 1000 iterations of a timestep of 0.1, we would reach a total time of 100, which would give an error of 100 × 0.0004 = &#039;&#039;&#039;0.04&#039;&#039;&#039;. Compared to the maximum displacement of the oscillator, which is 1.0, this is still only an error of ~ 4%. Therefore, it can be concluded that the error increases at such a slow rate with time that running a sizable amount of timesteps would still allow the simulation to remain within a reasonable approximation to the exact solution. Of course, this applies only to a timestep of 0.1, and the next task explores the effects of changing timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The displacement for a harmonic oscillator can be described by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=A\cos (\omega t + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillator can be given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;TE=\frac{1}{2}mv^2+\frac{1}{2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are all equal to one for the displacement equation, then the analytical total energy is simply half the amplitude squared, which would be &#039;&#039;&#039;0.5&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Upon choosing different timesteps, the total energy of the algorithm solution oscillated between the analytical total energy and a lower value. It was seen that &#039;&#039;&#039;a timestep equal to or less than 0.2 would not change the total energy by more than 1%. &#039;&#039;&#039;The plot of the total energy of the Velocity-Verlet algorithm solution against time with a timestep of 0.2 is given below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq3.png|frame|none|Oscillating total energy with time of the algorithm solution. The lower bound never reaches more than 1% below the analytical total energy.]]It is important to monitor the total energy of a system you are modelling numerically because:&lt;br /&gt;
* Comparing the numerical total energy values with the analytical values can tell you how accurate your algorithm is at modelling the system.&lt;br /&gt;
* One needs to observe whether the total energy has converged towards a constant average value, which would indicate that the system has reached thermodynamic equilibrium at its lowest energy state.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;To simulate the interactions between atoms in our simple liquid, the Lennard-Jones potential was used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to attain a potential equal to zero, the two terms in the brackets must equal each other.&lt;br /&gt;
&lt;br /&gt;
The separation&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;at which the potential energy is zero is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at a given separation is attained after differentiating the potential equation wrt&amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(r) = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The force at&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;is:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F(\sigma) = 4\epsilon \left( \frac{12}{\sigma} - \frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;is when&amp;lt;math&amp;gt;F=0&amp;lt;/math&amp;gt;. Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}=2^{1/6}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The potential energy at the equilibrium separation is given by:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)=4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integral of the potential was evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int\phi\left(r\right) dr= 4\epsilon \left( \frac{\sigma^{6}}{5r^{5}} - \frac{\sigma^{12}}{11r^{11}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fixing &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;to one, the following integrals were evaluated:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2\sigma}\phi\left(r\right) dr= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{2.5\sigma}\phi\left(r\right) dr= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int^{\infty}_{3\sigma}\phi\left(r\right) dr= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, but you could simplify your answer for the force at r0.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; In 1 mL of water under standard conditions, the density is approximately 1 g mL&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;, and the Mr of water is 18. The number of molecules can then be calculated:&lt;br /&gt;
&lt;br /&gt;
1/18 × 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;3.35 × 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; molecules&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Similarly the volume occupied by just 10000 water molecules can be calculated as:&lt;br /&gt;
&lt;br /&gt;
10000 / ( 6.022 × 10&amp;lt;sup&amp;gt;23&amp;lt;/sup&amp;gt; ) × 18 = &#039;&#039;&#039;3.00 × 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; mL&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since the volume simulated by just 10000 molecules is extremely small, periodic boundary conditions are imposed in order to better approximate bulk liquids. In such a system, an atom at position &#039;&#039;&#039;(0.5, 0.5, 0.5)&#039;&#039;&#039; in a cubic simulation box running from (0, 0, 0) to (1, 1, 1) which moves &#039;&#039;&#039;along a vector (0.7, 0.6, 0.2)&#039;&#039;&#039; would &#039;&#039;&#039;reach the position (0.2, 0.1, 0.7)&#039;&#039;&#039; after applying the periodic boundary conditions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Reduced units will also be used for the thermodynamic variables in the simulation.  &lt;br /&gt;
* Using the Lennard-Jones parameters for argon, if the LJ cutoff occurs at &#039;&#039;&#039;r* = 3.2, &#039;&#039;&#039;it is &#039;&#039;&#039;r = 1.088 nm&#039;&#039;&#039; in real units (σ&amp;lt;sub&amp;gt;Ar&amp;lt;/sub&amp;gt; = 0.34 nm). &lt;br /&gt;
&lt;br /&gt;
* The well-depth is &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt;as calculated before, and its value in kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt; can be calculated as:&lt;br /&gt;
&lt;br /&gt;
ⲉ / k&amp;lt;sub&amp;gt;B&amp;lt;/sub&amp;gt; = 120 K&lt;br /&gt;
&lt;br /&gt;
ⲉ = 1.656 × 10&amp;lt;sup&amp;gt;-21&amp;lt;/sup&amp;gt; J&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ⲉ = 0.997 kJ mol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
* The reduced temperature &#039;&#039;&#039;T* = 1.5&#039;&#039;&#039; in real units would be&#039;&#039;&#039;:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T&#039;&#039;&#039; = 1.5 × ⲉ / k&amp;lt;sub&amp;gt;B &amp;lt;/sub&amp;gt;= &#039;&#039;&#039;180 K&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
In order to start our algorithm we need to assign the initial positions of our atoms. However, liquids don&#039;t have long range order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Though assigning random positions to the atoms inside the simulation box would achieve the lower degree of long range order characteristic of liquids, this could cause problems. If you have two atoms generated very close to each other for example, the LJ potential will approach infinity at the small separation, generating a large repulsive force between them. If the simulation randomly generates many atom pairs too close to each other, most of the atoms in the system will fly apart from each other at very high speeds due to experiencing strong repulsive forces (i.e. the entire system will fly apart). This is not characteristic of a flowing liquid whereby the atoms are at a separation whereby they are still held together by attractive forces. Or rather, liquids don&#039;t spontaneously fly apart, but instead flow.&lt;br /&gt;
&lt;br /&gt;
Therefore, the simulation will start from a simple cubic lattice. If simulated for a long enough time under the correct potentials, the atoms will rearrange into positions more reminiscent of a liquid (i.e. we have melted the crystal)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces make the simulation unstable and can cause it to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:&#039;&#039;&#039; Within the input file, the following command creates a simple cubic lattice (one lattice point per unit cell), with a number density of 0.8.&lt;br /&gt;
 lattice sc 0.8&lt;br /&gt;
The output file indicates that the distance between the LPs is 1.07722 (reduced units).&lt;br /&gt;
 Lattice spacing in x,y,z = 1.07722 1.07722 1.07722&lt;br /&gt;
Within a cubic lattice, the LPs all occupy the corners of a cube, but the cube itself contains just one LP (due to sharing the LP with other cubes). Therefore the number density can be calculated as:&lt;br /&gt;
&lt;br /&gt;
1 / 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;0.8&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This indeed corresponds to the above input.&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 LPs for every cube, since the corner LPs are still present (and contribute 1/8 of an LP) and the facial LPs each contribute 1/2 of an LP. For a face-centered cubic lattice with a number density of 1.2, the side length will be (in reduced units):&lt;br /&gt;
&lt;br /&gt;
(4 / 1.2)&amp;lt;sup&amp;gt;1/3&amp;lt;/sup&amp;gt; = &#039;&#039;&#039;1.49380&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;For a face-centered cubic lattice, we assume that the following commands were inputted:&lt;br /&gt;
 region box block 0 10 0 10 0 10&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
There would be 1000 unit cells contained within the entire box. Since a face-centered cubic lattice has 4 LPs per unit cell, there would be &#039;&#039;&#039;4000 atoms&#039;&#039;&#039; of type 1 within this simulation box.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Within the LAMMPS script, the properties of the atoms and the interactions have to be specified through the following parameters:&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;
* The first line sets the masses of the atoms belonging to Type 1 to 1.0 (reduced units). Since a pure liquid is being simulated, only one atom type is present (Type 1).&lt;br /&gt;
* The second line adds pairwise LJ potential interactions between the atoms, whereby the interaction is calculated only if the atoms have a distance between them which is lower than or equal to 3.0 (reduced units). This cutoff or &#039;&#039;&#039;truncation&#039;&#039;&#039; of the potential is justified, since the integral of the LJ potential between a separation distance of 3.0 and positive infinity was previously calculated to be a small number. This signifies that interactions between atoms at a distance of 3.0 or higher are very small, and that they can be ignored within the simulation.&lt;br /&gt;
* The third line sets the two coefficients of the LJ potential (&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;and&amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;) for a pair of atoms. The two asterisks indicate that the coefficients will be applied to the LJ potential of &#039;&#039;all&#039;&#039; the pair interactions between the atoms (the equivalent of writing &amp;lt;math&amp;gt; \sum_i^N \sum_{i \neq j}^{N}&amp;lt;/math&amp;gt;). The coefficients are set to 1.0 in this case.&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Since &amp;lt;math&amp;gt;x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are being specified for this simulation, the Velocity-Verlet algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The following lines were typed into the input script&#039;&#039;&#039;&lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
The second line creates a variable named &#039;timestep&#039; and assigns it a value of 0.001. This way, any subsequent line can easily call the variable&#039;s value again by typing ${timestep}. This allows for the timestep value to be more easily manipulated and stored in memory so that it can be easily accessed throughout the script. Furthermore, if the value needs to be changed, only the first line which created the variable needs to have the value changed and all subsequent variable calls will change value as well. This is a lot more effective than simply assigning the same value repeatedly to each function call.&lt;br /&gt;
&lt;br /&gt;
The purpose of the subsequent lines is to define more variables, such as the number of steps, to be used later as well. Since defining these variables relies on the values of previous variables, if the value of the previous variables were to change, then these variables would also scale appropriately with the change, which is another advantage of using variables.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;After running the simulation, plots of the energy, temperature and pressure of the simulated liquid system against time were made for when a timestep of 0.001 was used. Additionally, a plot of the energy of the system against time for different timestep sizes was also made:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq123.png|frame|none|Plots of various thermodynamic variables with time. A plot of the energy of the system against time for various timestep sizes is included at the bottom left.]]&lt;br /&gt;
&lt;br /&gt;
The system simulated at a timestep of 0.001 can be seen to reach an equilibrium in energy, temperature and pressure very quickly (less than 5.0 time units into a simulation that simulates 100 time units) as all three values rapidly reach an oscillation around an average value.&lt;br /&gt;
&lt;br /&gt;
Using the bottom left plot, it can be seen that the timestep of 0.0025 is the largest timestep that gives acceptable results, since it is larger than the 0.001 timestep but is seen to oscillate approximately around the same average total energy as that of the 0.001 timestep system. The larger timesteps may still give a stable average total energy (excluding 0.015), but these are higher than the average energy indicated by the timestep of 0.0025, which indicates that the higher timesteps have simulated a system which hasn&#039;t converged to the lowest energy state, which is the equilibrium state we desire.&lt;br /&gt;
&lt;br /&gt;
Particularly, choosing the largest timestep of 0.015 is a particularly bad choice because it doesn&#039;t even give a stable average total energy within the time given. Instead, it gives a total energy that increases further with time, which definitely indicates that the simulated system is not at an equilibrium.&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions (the NpT ensemble) ==&lt;br /&gt;
&#039;&#039;&#039;TASK (Choosing 10 phase points in the NpT ensemble): &#039;&#039;&#039;From the previous simulation under the NVE ensemble, it was seen that a timestep of 0.0025 was the largest that still gave a convergent energy for the system. The average temperature and pressure of the system under the NVE ensemble at a timestep of 0.001 was also calculated after cutting off the first 100 data points (there were 4000 data points for the temperature and pressure, so excluding the first 100 would remove the transient behavior while still leaving enough data points to calculate a reliable average). The following are the averages:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T* = 1.256&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;P* = 2.615&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From these averages indicated by the NVE ensemble, it can be seen that varying the pressure around the value of 2.6 would give reasonable results within the NpT ensemble. Ten simulations of the NpT ensemble were created, whereby a temperature range of 1.6, 1.8, 2.0, 2.2 and 2.4 was chosen and measured at the pressures of 2.5 and 3.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The temperature of the simulated system can be calculated using the equipartition theorem. However, the simulated temperature may differ from that of the target temperature, and so a factor of &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; must be multiplied with the velocities for the sum of the kinetic energy of the atoms in order to equalize with the target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;. Through this relation, one can solve for &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;E_K = \frac{3}{2}Nk_BT=\frac{1}{2}\sum_i m_i v_i^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\gamma^2}{2}\sum_i m_i  v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^2=\frac{\frac{3}{2} N k_B \mathfrak{T}} {\frac{3}{2} N k_B T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T} }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The following commands were given to adjust how many times the state of the system was measured.&lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density&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;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
 run 100000&lt;br /&gt;
On the&lt;br /&gt;
second last line, the values 100, 1000 and 100000 signify the way in which the&lt;br /&gt;
average of a certain variable is calculated. Specifically, there will be 1000&lt;br /&gt;
values of the temperature and other variables used to calculate the average&lt;br /&gt;
value on timestep 100000. Since the simulation only runs for 100000 timesteps,&lt;br /&gt;
there will only be one average calculated (if the value of 100000 was changed&lt;br /&gt;
to 10000 for example, there would be ten average values calculated at every&lt;br /&gt;
10000th timestep). The value of 100 indicates that the 1000 values used&lt;br /&gt;
to calculate the average will be taken from every 100 timesteps before the&lt;br /&gt;
100000th timestep. &lt;br /&gt;
&lt;br /&gt;
In other&lt;br /&gt;
words, for our simulation there will be 1000 values chosen from 1000 timesteps,&lt;br /&gt;
and the first four timesteps of the 1000 timesteps are 100000, 99900, 99800,&lt;br /&gt;
and 99700. This decrease by 100 timesteps will continue until we have the values from 1000 timesteps. The values sampled will then be used to calculate the average at the&lt;br /&gt;
100000th timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The densities of the various simulations were plotted against the corresponding temperatures and pressures with errors. Additionally, plots of the ideal gas density against temperature were also made for comparison.&lt;br /&gt;
[[Image:errliq12345.png|frame|none|Plots of the density against temperature for the NpT simulations at two different pressures. The lower graph also includes the equivalent plot using the ideal gas equation for comparison.]]The simulated densities are much lower than the equivalent densities plotted by the ideal gas law. This is because the ideal gas doesn&#039;t take into account any interactive forces between atoms, so atoms could cluster together as close as they want without any interaction occurring, allowing for more dense systems. Our simulation uses the LJ potential to supplie interactive forces between atoms, and it is the large repulsive term in the LJ potential equation that dominates the behavior of the LJ liquid. Since the potential and subsequent repulsive force would increase rapidly with decreasing separation, the atoms in our simulation will always keep a larger distance apart from each other within a certain volume, which would give them a lower density than the ideal gas at the same pressure and temperature.  &lt;br /&gt;
&lt;br /&gt;
This discrepancy appears to increase at higher pressures, since the height separation between the simulation plot and ideal gas plot at a pressure of 3.0 is higher than that at 2.5. This is because higher pressures for the ideal gas would continue to compress the atoms closer together without any hindrance from repulsive forces, while our LJ liquid does not change as much in density due to pressure since the repulsive forces are still holding the atoms at a certain distance apart.&lt;br /&gt;
&lt;br /&gt;
== Heat Capacity ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The simulation was run using the NVT ensemble so as to calculate the heat capacity of the system. The plot below shows the simulation being run through a range of temperatures and two densities, with the heat capacity per unit volume calculated. &lt;br /&gt;
[[Image:errliq123456.png|frame|none|Plot of the heat capacity per volume against temperature for the simulated system.]]&lt;br /&gt;
&lt;br /&gt;
The input file used to calculate the heat capacity is given here:&lt;br /&gt;
[[File:Cv_origin.in]]&lt;br /&gt;
&lt;br /&gt;
The heat capacity decreases with temperature as expected. As the temperature increases, more atoms begin to occupy the higher energy states, until almost all of the states are occupied. The energy gained from an increase in temperature would usually go towards increasing the energy level of an atom and not towards the kinetic energy, hence giving the atoms of our liquid a &#039;capacity to take in heat&#039; without changing temperature. If all the energy states are equally occupied, then the heat capacity will approach zero since there are no more higher energy states left for the atoms to occupy, and so the energy from an increase in temperature will go fully towards increasing the kinetic energy of the atoms.&lt;br /&gt;
&lt;br /&gt;
This is similar to the heat capacity predicted for a two-level system within the NVT ensemble, whereby the plot above is similar to the decay of the heat capacity of the two-level system after it passes the Schottky defect peak. Similar to these plots, the decay of the heat capacity of the two-level system is also due to the fact that both energy levels begin to get equally occupied at higher temperatures.&lt;br /&gt;
&lt;br /&gt;
The increase in heat capacity with increasing density is due to the fact that there are more atoms per unit volume if the density is higher. Therefore, more energy needs to be supplied in order to increase the temperature of a unit volume by one temperature unit, compared to the same volume containing less atoms.&lt;br /&gt;
&lt;br /&gt;
== The Radial Distribution Function ==&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The RDFs for a simulated LJ liquid, solid and gas were calculated and plotted as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq23.png|frame|none|Plot of the radial distribution functions of the three states]] &lt;br /&gt;
&lt;br /&gt;
The RDF for the solid has three distinct peaks at the beginning which can be used to find out about the coordination around an atom within the solid. The further peaks all fluctuate around an RDF value of 1, and their fluctuation signifies how the atoms in a solid are held more tightly in place and have long range order such that there is no smooth averaging of their positions. &lt;br /&gt;
&lt;br /&gt;
The RDF for a liquid features three peaks which correspond to the first, second and third hydration shells around an atom. The RDF does not approach zero between these peaks though, indicating that there is a chance of finding atoms between the hydration shells. After the peaks, the RDF averages out to a value of 1, since liquids have no long range order and thus on average the density of a shell a certain distance &#039;&#039;&#039;r&#039;&#039;&#039; from the center doesn&#039;t change. &lt;br /&gt;
&lt;br /&gt;
For the gas RDF, there is one peak after which it is subjected to the same averaging effect as the liquid RDF, since gases also lack long range order. The peak is probably due to the gas being surrounded by a sphere of other atoms held together by weak LJ attractive forces, and since there is only one peak rather than the three for a liquid RDF, this signifies that atoms in a gas have less of an attractive force on their neighbors than atoms in a liquid.&lt;br /&gt;
&lt;br /&gt;
The first three peaks of the solid RDF can be used to determine the coordination of the nearest neighbors and second nearest neighbours. The integral of the radial distribution function allows us to physically count how many atoms are included within a volume defined by a certain radius &#039;&#039;&#039;r&#039;&#039;&#039; from the central atom, and it can be overlayed with the normal RDF to give a sense of the coordination number for each of the three peaks.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq233.png|frame|none|Plot of the solid RDF overlaid with the solid RDF integral]] &lt;br /&gt;
&lt;br /&gt;
The first peak in the RDF corresponds approximately to the integral value of 12 in the graph, indicating that the first peak of the solid RDF corresponds to a coordination with 12 atoms. The second, smaller peak in the RDF corresponds to the integral value of 18, and if the first 12 atoms are subtracted, this leaves 6 atoms coordinated to the atom from the second RDF peak.&lt;br /&gt;
&lt;br /&gt;
Before deducing the coordination number of the third peak, a diagram can be drawn of the FCC lattice to show which lattice sites the three peaks could correspond to:&lt;br /&gt;
&lt;br /&gt;
[[Image:crystda2m.png|frame|none|Diagram of an FCC lattice showcasing the coordination of the nearest neighbours]] &lt;br /&gt;
&lt;br /&gt;
The first RDF peak corresponds do the red dots which form the 12 nearest neighbors to the central atom. The second peak corresponds to the blue dots which form the 6 second nearest neighbours. Finally, the third peak corresponds to the green dots forming the next 24 nearest neighbors. Therefore, the coordination number of the third peak should be 24, and this would correspond to a value of 42 for the integral plot, which can just barely be seen above the third peak since the line is sloping rather than forming a plateau. &lt;br /&gt;
&lt;br /&gt;
The lattice spacing is denoted by the distance to the second nearest neighbors as indicated by the diagram. Therefore, the lattice spacing is &#039;&#039;&#039;r ~ 1.5&#039;&#039;&#039; since this is the r value for the second RDF peak corresponding to the second nearest neighbors.&lt;br /&gt;
&lt;br /&gt;
== Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;In order to get a measure of how much our atoms move around in our simulation, we could calculate the diffusion coefficient. The diffusion coefficient can be calculated using the &#039;&#039;&#039;mean squared displacement&#039;&#039;&#039;, and this was calculated for simulations of an LJ solid, liquid and gas. The MSD was then plotted against time:&lt;br /&gt;
[[Image:errliq2123.png|frame|none|Plot of the MSD with time for the three states]] &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is directly proportional to the gradient of the MSD with time. With this knowledge, we can make estimates for the diffusion coefficient &#039;&#039;&#039;D&#039;&#039;&#039;.&lt;br /&gt;
# For a solid, the mean squared displacement is very low (0.02) and stays this way even after a certain amount of time. This is to be expected since atoms in a solid don&#039;t displace far from their original position and can only vibrate in place. Since the MSD doesn&#039;t really change with time, it has an almost zero gradient, which indicates a &#039;&#039;&#039;diffusion coefficient close to zero&#039;&#039;&#039;, which is also expected because solid atoms rarely (through defects) diffuse throughout a lattice. &lt;br /&gt;
# For a liquid, the MSD rises with time, since liquid atoms can flow around each other. Therefore, they can eventually reach a displacement quite far from their original positions. The gradient of the plot is estimated to be 0.5, which leads to the following calculation for the diffusion coefficient:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(0.5)=0.0833&amp;lt;/math&amp;gt;&lt;br /&gt;
# The MSD of an atom in a gas rises more quickly than that of an atom in a liquid, since atoms are free to move around in space within a gas (apart from colliding with other atoms). Therefore, they can very quickly stray far from their original position. If we estimate the gradient from the linear portion of the graph, then: &amp;lt;math&amp;gt;D_{gas}=\frac{1}{6}\frac{140-120}{9.77-8.77}=3.33&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient was also estimated for simulations of the three phases involving one million atoms.&lt;br /&gt;
[[Image:errliq212123.png|frame|none|Plot of the MSD with time for the three states using a simulation of one million atoms for each phase]] &lt;br /&gt;
# The diffusion coefficient of the solid is once again approximately zero since the gradient of the MSD against time is roughly zero in the plot.&lt;br /&gt;
# The diffusion coefficient for the liquid has increased slightly, whereby we can calculate:&amp;lt;math&amp;gt;D_{liq}=\frac{1}{6}(5.05/10)=0.0842&amp;lt;/math&amp;gt;. &lt;br /&gt;
# The diffusion coefficient for the gas is approximately the same as the value calculated for the simulation with less atoms.&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;Using the equation for the displacement of a simple harmonic oscillator, we can evaluate the &#039;&#039;&#039;velocity autocorrelation function&#039;&#039;&#039; as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A^2\omega^2 \sin(\omega t+\phi)\sin(\omega (t+\tau) + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} A^2\omega^2 \sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using trigonometric identities:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} \frac{1}{2} (\cos(\omega \tau)-\cos(2\omega t + 2\phi +\omega\tau))\mathrm{d}t}{\int_{-\infty}^{\infty} \frac{1}{2} (1-\cos(2\omega t+2\phi))\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We evaluate the integral:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t + 2\phi +\omega\tau))|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}-(\frac{1}{2\omega}\sin(2\omega t+2\phi))|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals involving the sin functions are always bounded to be between -1 and 1, so the much larger &amp;lt;math&amp;gt;t|^{\infty}_{-\infty}&amp;lt;/math&amp;gt; term will dominate the fraction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{ \cos(\omega \tau)t|^{\infty}_{-\infty}}{  t|^{\infty}_{-\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \cos(\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function for the SHO, LJ liquid and solid can be compared as below:&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112123.png|frame|none|Plot of various VACFs plotted against timestep]] &lt;br /&gt;
&lt;br /&gt;
The VACF is a measure of how much the current velocity of an atom affects its future velocity (how much they correlate). The minima in the solid and liquid VACFs denote oscillatory behavior for the atoms, whereby the solid phase atoms oscillate in place and reverse their velocities at the end of each oscillation. That is why there are still minima and maxima present for the solid VACF at later times, because the velocity of the atom does have an effect on its future velocity due to influencing its vibration in place. For the liquid phase, the atoms are allowed to flow around each other and diffuse throughout the system, so the correlation rapidly decays exponentially with time since the initial velocity has no effect on the later velocities. There is only one minimum corresponding to one occurrence of velocity reversal for a liquid phase atom, which may correspond to a single collision with another atom before diffusing in the opposite direction. Since liquid atoms don&#039;t vibrate in place, there wouldn&#039;t be any further minima in the VACF. &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator seems to have the highest correlation in velocity with time, and its VACF is very different to that of an LJ liquid and solid because the SHO uses a symmetric harmonic potential rather than the anharmonic LJ potential. The oscillator can&#039;t diffuse anywhere since it is trapped in the potential well, and its velocities are more correlated than those of an LJ solid because the potential well is symmetric and not subject to more than one kind of interaction, such as the repulsion and attraction simulated by the LJ potential. &lt;br /&gt;
&lt;br /&gt;
Therefore, the vibrations of the SHO are more ordered and restricted to a single dimension than the vibrations of the LJ solid atoms, and the VACF for the SHO is strictly periodic with symmetric minima that, unlike the minima of the LJ solid, never dampen.&lt;br /&gt;
&lt;br /&gt;
The LJ solid could actually be considered a dampened oscillator, since all its atoms are vibrating in place, but since the LJ potential is asymmetric, there is more chance for a random pair of atomic interactions to be different from the last, causing future velocities to &#039;lose their memory&#039; of the initial velocity. Hence the LJ solid VACF is still lower than that of a perfect oscillator (but still higher than the VACF for a liquid).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: &#039;&#039;&#039;The trapezium rule was used to calculate the running integral of the VACF wrt time. The result was then plotted against time for the solid, liquid and gas simulations.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq22115124155112123.png|frame|none|Plot of the running integral of the VACF against time for the three phases]]Similar to the MSD, the diffusion coefficients can be estimated from these running integrals. Since the relation of the VACF to the diffusion coefficient is given as:&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it is evident that the value of the running integral at &amp;lt;math&amp;gt;t=/infty&amp;lt;/math&amp;gt; will be equal to the diffusion coefficient multiplied by three. In practice, we simply need to observe when the running integrals in these plots converge to a certain value, and divide the value by three to get the diffusion coefficient.&lt;br /&gt;
# For the &#039;&#039;&#039;solid&#039;&#039;&#039;, the running integral converges to zero, so the &#039;&#039;&#039;diffusion coefficient must be zero&#039;&#039;&#039;, as expected of atoms which can only vibrate in place.&lt;br /&gt;
# For the &#039;&#039;&#039;liquid&#039;&#039;&#039;, the running integral converges to a value of about 0.3, which then gives a &#039;&#039;&#039;diffusion coefficient of 0.1 &#039;&#039;&#039;after dividing by three. This is in good agreement with the previously calculated diffusion coefficient of 0.0833 using the MSD.&lt;br /&gt;
# For the &#039;&#039;&#039;gas&#039;&#039;&#039;, the running integral seems to just converge at a value of about 10, which gives a &#039;&#039;&#039;diffusion coefficient of 3.33&#039;&#039;&#039;. This is almost exactly the same as the value calculated using the MSD, and as expected, the diffusion coefficient of a gas is the highest among the phases, with liquids being in between solids and gas.&lt;br /&gt;
Similar to the case of MSD, the diffusion coefficient was also estimated using the running integrals from simulations involving one million atoms.&lt;br /&gt;
&lt;br /&gt;
[[Image:errliq221155112647123.png|frame|none|Plot of the running integral of the VACF against time for the three phases using one million atoms for the simulation]] &lt;br /&gt;
&lt;br /&gt;
For the solid and gaseous simulations, the estimate of the diffusion coefficient will be very similar to that of the simulations that used less atoms.&lt;br /&gt;
* For the liquid simulation using one million atoms, the noise has at least been smoothed out and we can make out a clearer convergence of the running integral at about 0.27. This gives a value of &#039;&#039;&#039;0.09 for the diffusion coefficient&#039;&#039;&#039;.&lt;br /&gt;
The largest source of error in calculating &#039;&#039;&#039;D&#039;&#039;&#039; from the VACF is possibly from the use of the trapezium rule, which is one of the simplest forms of numerical integration. A more precise method, such as Simpson&#039;s rule which uses fitting quadratics, could lead to an estimate of the diffusion coefficient with a smaller error.&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Y3C_Liquid_Simulation:hjt14&amp;diff=591699</id>
		<title>Talk:Y3C Liquid Simulation:hjt14</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Y3C_Liquid_Simulation:hjt14&amp;diff=591699"/>
		<updated>2017-02-28T03:45:21Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Very good report, results are well presented and accompanied by good explanations which demonstrate a good understanding of th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Very good report, results are well presented and accompanied by good explanations which demonstrate a good understanding of the background theory behind this experiment, well done.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 1: Running First Simulation==&lt;br /&gt;
No task.&lt;br /&gt;
&lt;br /&gt;
==Section 2: Introduction to Molecular Dynamics Simulation==&lt;br /&gt;
===Numerical Integration===&lt;br /&gt;
====Task====&lt;br /&gt;
[[Media:HO hjt14.xls| Link]] to the completed HO.xls file. The followings are the graph constructed using data from the excel worksheet. The first graph is an overlap of two graph of position of simple harmonic oscillator, &amp;lt;math&amp;gt; x(t) &amp;lt;/math&amp;gt;, as a function of time, &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt;; one calculated using velocity verlet algorithm, and one calculated using &amp;lt;math&amp;gt;  x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;. The second graph is the graph of total energy of the simple harmonic oscillator, &amp;lt;math&amp;gt; E_{total}(t) &amp;lt;/math&amp;gt;, as a function of time, &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt;. The third graph is the graph of absolute error (difference between in position, &amp;lt;math&amp;gt; x(t) &amp;lt;/math&amp;gt;, calculated using classical harmonic oscillator solution and calculated using velocity verlet algorithm) as a function of time, &amp;lt;math&amp;gt; t&amp;lt;/math&amp;gt;. The maximas were located from each parabola and were fitted with a linear function. The equation of the linear function is displayed on the graph.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Graphs from excel file&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Graph of Position of Simple Harmonic Oscillator Against Time (Time Step= 0.100).PNG|x500px|thumb|Graph 1]] &lt;br /&gt;
|-&lt;br /&gt;
| [[File:Graph of Total Energy of Simple Harmonic Oscillator Against Time (Time Step= 0.100).PNG|x500px|thumb|Graph 2]]&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Graph of Absolute Error Against Time (Time Step= 0.100).PNG|x500px|thumb|Graph 3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Since we are working in a close system, i.e., no energy exchange with surrounding, the total energy of the system should be a constant. What we observed from graph 2 is that the total energy of the system oscillates about an average value. The deviation from the average energy is treated as the error introduced by the approximation we made in velocity verlet algorithm. The percentage error of total energy at different timestep were computed using following equation and the results are summarized in graph 4:&lt;br /&gt;
&lt;br /&gt;
Percentage Error &amp;lt;math&amp;gt; = \frac{(E_{max}-E_{min})}{2\times E_{average}} \times100 % &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Graph of Percentage Error of Total Energy Against Timestep.PNG|x500px|thumb|centre|Graph 4]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from graph 4 that for timestep beyond 0.28, the percentage error in total energy will exceed 1%.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, thorough analysis and choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
====Task====&lt;br /&gt;
Lennard-Jones Equation: &amp;lt;math&amp;gt;\phi (r)=4\epsilon \left( \frac{\sigma ^{12}}{r^{12}}-\frac{\sigma ^6}{r^6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When potential energy is set to zero, i.e.&amp;lt;math&amp;gt;\phi =0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 0=4\epsilon \left( \frac {\sigma ^{12}}{r^ {12}} - \frac {\sigma ^6}{r ^6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac {\sigma ^ {12}}{r^{12}} = \frac{\sigma ^6}{ r^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac {\sigma ^ 6}{r^ 6} = 1 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma  = r = r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; when potential energy &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; is set to zero,&amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt;, is equal to &amp;lt;math&amp;gt;\sigma &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The force acting on a particle a distance &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; away from another particle can be calculated using following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F= - \frac {d\phi(r)}{dr} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F= 4 \epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac {6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; r= r_0 =\sigma &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=4\epsilon \left( \frac{12\sigma^{12}}{\sigma^{13}}-\frac{6\sigma^6}{\sigma^7} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=4\epsilon \left( \frac{12}{\sigma}-\frac{6}{\sigma} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=\frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At distance &amp;lt;math&amp;gt; r_0 &amp;lt;/math&amp;gt;, where the potential energy, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;, is zero, the force acting on a particle is equal to &amp;lt;math&amp;gt;\frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;F=0&amp;lt;/math&amp;gt;, defines &amp;lt;math&amp;gt; r=r_{eq}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F=0= 4 \epsilon \left( \frac{12\sigma^{12}}{r_{eq}^{13}} - \frac{6\sigma^6}{r_{eq}^7} \right) &amp;lt;/math&amp;gt;&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;
&amp;lt;math&amp;gt; 2\sigma^6=r_{eq}^6 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq}= \sqrt[6]{2} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium distance,&amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt; , between 2 particles, which is defined as separation of 2 particles when the force acting on each particle is zero, is equal to &amp;lt;math&amp;gt;\sqrt[6]{2} \sigma &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \sigma &amp;lt;/math&amp;gt; is a constant and is specific to particle under study. At equalibrium distance, &amp;lt;math&amp;gt; r_{eq} &amp;lt;/math&amp;gt;, the potential energy, &amp;lt;math&amp;gt; \phi(r_{eq}) &amp;lt;/math&amp;gt;, is at minimum and can be caculated as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4 \epsilon \left(\frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}}-\frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = 4 \epsilon \left(\frac{1}{4}-\frac{1}{2} \right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi(r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following part shows the working of the integration of potential energy, &amp;lt;math&amp;gt; \phi &amp;lt;/math&amp;gt;, with respect to &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt;. The integral is equivalent to the area under the potential energy graph encompassed by the integration range, &amp;lt;math&amp;gt; x &amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt; y&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_x^y \phi(r) dr = \int_x^y 4\epsilon \left(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6} \right) dr &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_x^y \phi(r) dr = 4\epsilon \left[\frac{-\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5} \right]_x^y &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt; \epsilon =1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma=1 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_x^y \phi(r) dr = 4 \left[\frac{-1^{12}}{11r^{11}}+\frac{1^6}{5r^5} \right]_x^y &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|When &amp;lt;math&amp;gt; x=2\sigma=2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; y=\infty &amp;lt;/math&amp;gt;: &lt;br /&gt;
|When &amp;lt;math&amp;gt; x=2.5\sigma=2.5 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; y=\infty &amp;lt;/math&amp;gt;:&lt;br /&gt;
|When &amp;lt;math&amp;gt; x=3\sigma=3 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; y=\infty &amp;lt;/math&amp;gt;:&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;math&amp;gt; \int_2^\infty \phi(r) dr = 4 \left[\frac{-1^{12}}{11r^{11}}+\frac{1^6}{5r^5} \right]_2^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_2^\infty \phi(r) dr = 4 \left[0-\left(\frac{-1^{12}}{11(2^{11})}+\frac{1^6}{5(2^5)} \right)\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_2^\infty \phi(r) dr = -\frac{699}{28160} = -0.0248 &amp;lt;/math&amp;gt; &lt;br /&gt;
|&amp;lt;math&amp;gt; \int_{2.5}^\infty \phi(r) dr = 4 \left[\frac{-1^{12}}{11r^{11}}+\frac{1^6}{5r^5} \right]_{2.5}^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{2.5}^\infty \phi(r) dr = 4 \left[0-\left(\frac{-1^{12}}{11(2.5^{11})}+\frac{1^6}{5(2.5^5)} \right)\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{2.5}^\infty \phi(r) dr = -0.00818 &amp;lt;/math&amp;gt;&lt;br /&gt;
|&amp;lt;math&amp;gt; \int_3^\infty \phi(r) dr = 4 \left[\frac{-1^{12}}{11r^{11}}+\frac{1^6}{5r^5} \right]_3^\infty &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_3^\infty \phi(r) dr = 4 \left[0-\left(\frac{-1^{12}}{11(3^{11})}+\frac{1^6}{5(3^5)} \right)\right] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_3^\infty \phi(r) dr = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and well laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
====Task====&lt;br /&gt;
The number of water molecules in 1 ml of water under standard conditions (298K and 1 atm) is calculated as follow:&lt;br /&gt;
&lt;br /&gt;
Density of water under standard conditions&amp;lt;math&amp;gt; = 0.9970 g ml^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mass of 1 ml of water &amp;lt;math&amp;gt;=0.9970 g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Molar mass of water &amp;lt;math&amp;gt; = 2(1.008)+15.999 = 18.015 gmol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Number of water molecule in 1 ml of water &amp;lt;math&amp;gt; = \frac{0.9970(6.022\times 10^{23})}{18.015} = 3.333\times10^{22} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume occupied by 1000 water molecules under standard conditions is calculated as follow:&lt;br /&gt;
&lt;br /&gt;
Mass of 1000 water molecules &amp;lt;math&amp;gt;=\frac{1000}{6.022\times10^{23}} (18.015) = 2.992\times 10^{-20}g  &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume occupied by 1000 water molecules &amp;lt;math&amp;gt; = \frac{2.992\times 10^{-20}}{0.9970}=3.001\times 10^{-20}ml &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
Under periodic boundary condition, the final position of an atom, after it move from &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0.5\\&lt;br /&gt;
0.5\\&lt;br /&gt;
0.5&lt;br /&gt;
\end{pmatrix} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
by &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0.7\\&lt;br /&gt;
0.6\\&lt;br /&gt;
0.2&lt;br /&gt;
\end{pmatrix} &lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&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;, can be calculated as follow:&lt;br /&gt;
&lt;br /&gt;
New position of atom &amp;lt;math&amp;gt; =&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0.5\\&lt;br /&gt;
0.5\\&lt;br /&gt;
0.5&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
+&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0.7\\&lt;br /&gt;
0.6\\&lt;br /&gt;
0.2&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
=&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
1.2\\&lt;br /&gt;
1.1\\&lt;br /&gt;
0.7&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply periodic boundary condition:&lt;br /&gt;
&lt;br /&gt;
New position of atom&lt;br /&gt;
&amp;lt;math&amp;gt;=&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
1.2-1\\&lt;br /&gt;
1.1-1\\&lt;br /&gt;
0.2&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
=&lt;br /&gt;
\begin{pmatrix}&lt;br /&gt;
0.2\\&lt;br /&gt;
0.1\\&lt;br /&gt;
0.2&lt;br /&gt;
\end{pmatrix}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
====Task====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|The real units, &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt;, is calculated as follow:&lt;br /&gt;
|The well depth in &amp;lt;math&amp;gt; kJ mol^{-1} &amp;lt;/math&amp;gt; is calculated as follow:&lt;br /&gt;
|The reduced temperature &amp;lt;math&amp;gt; T^* = 1.5 &amp;lt;/math&amp;gt; in real units is calculated as follow:&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt; r^*= \frac{r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^*= 3.2 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \sigma= 0.34 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r= 3.2(0.34) nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r= 1.088 nm &amp;lt;/math&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\epsilon}{N_Ak_B} =120 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\epsilon}{R} =120 K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 120(8.31) J mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \epsilon = 997 J mol^{-1}= 0.997 kJ mol^{-1} &amp;lt;/math&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;math&amp;gt; T^*=\frac{k_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 1.5= \frac{1}{120}T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T= 180 K &amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 3: Equilibration==&lt;br /&gt;
===Creating the Simulation Box===&lt;br /&gt;
====Task====&lt;br /&gt;
Within an input file for molecular simulation, the initial conditions stipulated may not be the equilibrium conditions. During a simulation, LAMMPS will try to bring the system down to the equilibrium state by iteration within the allowed timesteps specified in the input file. If random coordinate is assigned to each atom, there is a chance that two or more atoms will be assigned coordinates that are too close together. This will mean that the atoms overlap in space. According to Lennard-Jones equation, this condition will give rise to the extremely high potential energy (approach infinity) and large repulsion between atoms. As a result of this situation, calculations done using LAMMPS sumulator will run into errors and the system will not be brought to equilibrium state.&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
A unit cell of a simple cubic lattice is a cube dotted with lattice point at each vertice. Each vertice is shared between 4 unit cells, hence each vertice will contribute a quarter of a lattice point to a unit cell. Consequently, each unit cell will have lattice point, 4 corners each contributes a quarter of a lattice point. The number density can be calculated by dividing the number of lattice point in a unit cell by the volume of a unit cell.&lt;br /&gt;
&lt;br /&gt;
If we have a unit cell of size &amp;lt;math&amp;gt; 1.07722 \times 1.07722 \times 1.07722 &amp;lt;/math&amp;gt; (in redued units):&lt;br /&gt;
&lt;br /&gt;
Number density of a simple cubic lattice &amp;lt;math&amp;gt; = \frac{1}{1.07722 \times 1.07722 \times 1.07722} =0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we have a face-centered cubic lattice with lattice point number density of &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt;, we can calculate the size of unit cell as follow:&lt;br /&gt;
&lt;br /&gt;
Number of lattice point in a face-centered cubic unit cell &amp;lt;math&amp;gt; =4&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of unit cell &amp;lt;math&amp;gt;= l\times l\times l = l^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l^3= \frac{4}{1.2} =3\frac{1}{3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l=\sqrt[3]{3\frac{1}{3}} =1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The lattice parameter of a face-centered cubic lattice with lattice point number density of &amp;lt;math&amp;gt;1.2&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt; 1.49 &amp;lt;/math&amp;gt; (in reduced units).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
The number of unit cell created in the defined region is &amp;lt;math&amp;gt; 1000 &amp;lt;/math&amp;gt;. In each face-centered cubic unit cell, &amp;lt;math&amp;gt; 4 &amp;lt;/math&amp;gt; atoms will be generated. Consequently, the total number of atom that will be generated if a face-centered cubic lattice is used instead of a simple cubic lattice is &amp;lt;math&amp;gt;4000&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Setting the Properties of the Atoms===&lt;br /&gt;
====Task====&lt;br /&gt;
{| width=50%&lt;br /&gt;
| &amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first line of the command set the mass of the atom of type 1 to 1.0 (reduced units). The second line of the command defines the equation used to model the pairwise interaction energy between atoms. In this example, we are using Lennard-Jones Equation with a cutoff distance of 3.0 (reduced units). The third line of the command defines the coefficients of Lennard-Jones Equation, i.e &amp;lt;math&amp;gt; \epsilon =\sigma = 1.0 &amp;lt;/math&amp;gt;. The asterisks (* *) mean that the Lennard-Jones model will be imposed on every pair of atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, why do we use a cutoff with a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
Given that we are specifying &amp;lt;math&amp;gt;x_i\left(0\right) &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i\left(0\right) &amp;lt;/math&amp;gt;, the integration algorithm that we will be using is velocity verlet  algorithm.&lt;br /&gt;
&lt;br /&gt;
===Running the Simulation===&lt;br /&gt;
====Task====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By assigning a variable (timestep) to timestep (the value), it allows us to call &#039;timestep&#039; at other part of the input script, meaning that we do not have to retype the exact value of timestep repeatly and allow us to call it simply by typing ${timestep}. Another advantage of assigning a variable (timestep) to timestep (the value), is that if we need to change the timestep of a simulation, we only need to change the value assigned to the variable &#039;timestep&#039; and timestep in other part of the input file will be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking Equilibrium===&lt;br /&gt;
====Task====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Graphs Obtained at 0.001 Timestep&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Intro 0.001 Timestep total energy hjt14.png|thumb|500px|Graph 5]] &lt;br /&gt;
| [[File:Intro 0.001 Timestep Temperature hjt14.png|thumb|500px|Graph 6]] &lt;br /&gt;
| [[File:Intro 0.001 Timestep Pressure hjt14.png|thumb|500px|Graph 7]] &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Above show three graphs obtained from LAMMPS simulation ran at 0.001 timestep. It can be seen that the system did achieved equilibrium and the inset in each graph show that system achieve equilibrium in approximately 0.4 fs. LAMMPS simulations were also ran at other timestep and the results for total energy were summarised in graph 8.   &lt;br /&gt;
&lt;br /&gt;
[[File:Intro Total Energy Diff Timestep hjt14.png|thumb|centre|500px|Graph 8]]&lt;br /&gt;
&lt;br /&gt;
From graph 8, it can be seen that the most suitable timestep is 0.0025 as it is the maximum value which still allow the system under study to achieve equilibrium (a compromise between accuracy and time). 0.015 is a particularly bad choice because the system simulated at that timestep did not converge.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, but why are 0.01 and 0.0075 no good - should the average total energy depend on the timestep?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 4: Running Simulations under Specific Conditions==&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
====Task====&lt;br /&gt;
In order to bring the system to target temperature, &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;, we multiply the velocity of each particle with a constant factor, &amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt;, which will help to modulate the velocity of each atoms. The factor,&amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt;, can be derived as follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_K=\frac{1}{2} \sum_i m_i v_i^2 = \frac{3}{2}NK_BT &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt; T= \mathfrak{T} &amp;lt;/math&amp;gt; and multiply velocity of each atom with a constant factor, &amp;lt;math&amp;gt;\gamma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_K=\frac{1}{2} \sum_i m_i \gamma^2v_i^2 = \frac{3}{2}NK_B\mathfrak{T} &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{1}{2} \sum_i m_i v_i^2 = \frac{3}{2}NK_B\mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}NK_BT = \frac{3}{2}NK_B\mathfrak{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt{\frac{\mathfrak{T}}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
====Task====&lt;br /&gt;
&amp;lt;pre&amp;gt;sampled&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The numbers and its position in the series will affect how the averages are calculated. The roles that each number play are summarised as follow:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Position&lt;br /&gt;
! Value&lt;br /&gt;
! Role&lt;br /&gt;
|-&lt;br /&gt;
| First&lt;br /&gt;
| 100&lt;br /&gt;
| Sample data every 100 timestep&lt;br /&gt;
|-&lt;br /&gt;
| Second&lt;br /&gt;
| 1000&lt;br /&gt;
| Perform sampling 1000 times&lt;br /&gt;
|-&lt;br /&gt;
|Third&lt;br /&gt;
|100000&lt;br /&gt;
|Average all the sampled data collected within 100000 timestep&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
====Task====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&#039;2&#039;|Conditions used&lt;br /&gt;
! rowspan=&#039;2&#039;|Graph&lt;br /&gt;
|-&lt;br /&gt;
!Pressure&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&#039;5&#039;| 2.0 &lt;br /&gt;
| 1.8&lt;br /&gt;
| rowspan=&#039;10&#039;| [[File:Section 4 NPT graph hjt14.png|thumb|500px|Graph 9]]&lt;br /&gt;
|-&lt;br /&gt;
|2.0&lt;br /&gt;
|-&lt;br /&gt;
|2.2&lt;br /&gt;
|-&lt;br /&gt;
|2.4&lt;br /&gt;
|-&lt;br /&gt;
|2.6&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&#039;5&#039;| 3.0&lt;br /&gt;
| 1.8&lt;br /&gt;
|-&lt;br /&gt;
|2.0&lt;br /&gt;
|-&lt;br /&gt;
|2.2&lt;br /&gt;
|-&lt;br /&gt;
|2.4&lt;br /&gt;
|-&lt;br /&gt;
|2.6&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Shown in the table, are 10 phase points used in LAMMPS molecular dynamic simulation to compute density under these conditions. The theoretical value of density at these phase points were also calculated using reduced ideal gas equation. The simulated density and calculated density are summarised in graph 9. The reduced ideal gas equation used in calculation is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
\rho =\frac{P}{T^*};   \rho=\frac{N}{V}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In graph 9, it can be seen that:&lt;br /&gt;
&lt;br /&gt;
a) at all temperature, the simulated density are lower than the theoretical density.&lt;br /&gt;
&lt;br /&gt;
Explanation: In ideal gas, we assume there are no inter-molecular interactions between particles, i.e., no attraction and no repulsion. However, in our LAMMPS simulation, we model the inter-molecular interactions using Lennord-Jones equation and this breaks the fundamental assumption made in the derivation of ideal gas equation. According to Lennard-Jones equation, below a certain bond distance, a particles pair will experience repulsive forces which will keep them at a distance away from each other. In this case, the particles are further apart from each other than they would be if they behave ideally. Consequently, the number of particle per unit volume, which is the density, is lowered.   &lt;br /&gt;
&lt;br /&gt;
b) the simulated density deviate considerably from ideal behavior at low temperature. At higher temperature, the magnitude of deviation decreases and the theoretical density and simulated density start to converge to a single value.&lt;br /&gt;
&lt;br /&gt;
Explanation: At low temperature, the thermal energy, &amp;lt;math&amp;gt; k_BT &amp;lt;/math&amp;gt;, is small relative to the interaction energy. Therefore the interaction energy can not be neglected and contribute significantly to the thermodynamic properties of our system. As temperature starts to increase, the thermal energy increases and at one point the magnitude of the thermal energy will become comparable to the interaction energy. At that point, the interactions between particles can be easily perturbed by thermal fluctuation and hence become irrelevant in determining the thermodynamic properties of our system. In other words, at higher temperature, interactions between particles become insignificant and system approaches ideal behavior. Therefore, simulated density and theoretical density converge to a single value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanations.  Why are the ideal gas and simulation results closer at lower pressure?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 5: Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
====Task====&lt;br /&gt;
[[Media:Nvt(0.2, 2.0, 0.0025).in|Link]] to one of the input file. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&#039;2&#039;|Conditions used&lt;br /&gt;
! rowspan=&#039;2&#039;|Graph&lt;br /&gt;
|-&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&#039;5&#039;| 0.2 &lt;br /&gt;
| 2.0&lt;br /&gt;
| rowspan=&#039;10&#039;| [[File:Section 5 CvV vs T.png|thumb|500px|Graph 10]]&lt;br /&gt;
|-&lt;br /&gt;
|2.2&lt;br /&gt;
|-&lt;br /&gt;
|2.4&lt;br /&gt;
|-&lt;br /&gt;
|2.6&lt;br /&gt;
|-&lt;br /&gt;
|2.8&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&#039;5&#039;| 0.8&lt;br /&gt;
| 2.0&lt;br /&gt;
|-&lt;br /&gt;
|2.2&lt;br /&gt;
|-&lt;br /&gt;
|2.4&lt;br /&gt;
|-&lt;br /&gt;
|2.6&lt;br /&gt;
|-&lt;br /&gt;
|2.8&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Pressure is defined as &amp;lt;math&amp;gt; \frac{N}{V} &amp;lt;/math&amp;gt;, at higher pressure there will be more particle per unit volume. In section 4, we encounter following equation which correlates the instantaneous temperature of a system to total kinetic energy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
E_K = \frac{3}{2} N k_B T = \frac{1}{2}\sum_i m_i v_i^2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Occupying the same volume, a system at higher pressure will have a greater number of particles. Therefore, for the same increment in temperature, the energy we need to provide to a system at higher density is greater than that of a system at lower pressure simply because there are more particles to which we have to provide the energy. Consequently, the heat capacity per unit volume of a system at higher pressure is greater than that of system at lower pressure simply because we need to provide more energy for the same increment in temperature.&lt;br /&gt;
&lt;br /&gt;
According to equipartition theorem, each degree of freedom of an atom will contribute &amp;lt;math&amp;gt; \frac{1}{2} k_B &amp;lt;/math&amp;gt; to the total heat capacity of the system. As we are modeling a constant number of atoms, we expect the heat capacity of the system to be a constant. For both graphs, there is no clear reason to why the heat capacity reduces with temperature. One possible reason is that the density of state decreases with temperature. Higher density of state means that the energy levels are closer together and are easy to populate the energy states and hence correlate to lower heat capacity; Lower density of state means that the energy gap between energy levels is larger and and are difficult to populate the energy states. For same increment in temperature, greater energy need to be provided, and hence this correlate to higher heat capacity. One way to verify this is to obtain a plot of density of state versus energy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of the trend with pressure and good ideas to explain the trend with temperature - more analysis, beyond the scope of this experiment, would be needed to confirm this trend.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 6: Structural Properties and the Radial Distribution Function==&lt;br /&gt;
===Calculating &amp;lt;math&amp;gt;g(r) &amp;lt;/math&amp;gt; in VMD===&lt;br /&gt;
====Task====&lt;br /&gt;
&amp;lt;math&amp;gt; g(r)&amp;lt;/math&amp;gt; can be understood as the number of particle per unit volume of shell of size &amp;lt;math&amp;gt; dr &amp;lt;/math&amp;gt; divided by the bulk density.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Graphs&lt;br /&gt;
!Observed trends in graphs when going from solid to liquid and to gas&lt;br /&gt;
!Remark&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&#039;3&#039;| [[File:Part 6 gr hjt14.png|thumb|600px|Graph 11]]&lt;br /&gt;
&lt;br /&gt;
[[File:Part 6 int g hjt14.png|thumb|600px|Graph 12]]&lt;br /&gt;
&lt;br /&gt;
|The peak intensity decreases and has greater width&lt;br /&gt;
|In solid, the atoms are closely packed and hence are in higher coordination environment and this translates into high &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt;. From solid to gas, the coordination environment drop as the atoms are more loosely packed in this case and  hence &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; decreases from solid to gas. The width of the peak is related to the distribution of &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt;of atoms in the first coordination shell, then second coordination shell and etc.. In solid, the peaks are more confined than that of liquid and gas. This is because solid has low degree of freedom in motion, i.e., no translation, hence &amp;lt;math&amp;gt; r &amp;lt;/math&amp;gt; of atoms in each coordination shell has smaller distribution and this gives rise to relatively sharp peaks. From liquid to gas, the translational degree of freedom increases, and hence the position of atoms in coordination shell becomes less and less well defined. This uncertainty in &amp;lt;math&amp;gt;r &amp;lt;/math&amp;gt;gives rise to wide peaks.  &lt;br /&gt;
|-&lt;br /&gt;
|The rate of decay of &amp;lt;math&amp;gt; g(r) &amp;lt;/math&amp;gt; increases&lt;br /&gt;
|This is because solid has long range order in the spatial arrangement of atoms. In liquid and gas, the ordered structure is short range and over &amp;lt;math&amp;gt; r&amp;lt;/math&amp;gt; the peaks flattened out as atoms distribution is getting more and more random. &lt;br /&gt;
|-&lt;br /&gt;
|Coordination environment decreases&lt;br /&gt;
|&#039;&#039;&#039;REFERRING TO SOLID&#039;&#039;&#039; The first coordination shell of solid consisted of 12 particles (cuboctahedron) and corresponds to the first peak of solid &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot. The second coordination shell of solid consists of 6 particles (octahedron) and corresponds to the second peak of solid &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot. The third coordination shell of solid consists of 24 particles and corresponds to the third peak of solid &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot. The position of atoms in these shells are shown below relative to a reference point (coloured black):&lt;br /&gt;
&lt;br /&gt;
[[File:FCC neighbour.jpg|thumb|400px|centre|FCC lattice made using crystal maker. Black atom is the reference atom, yellow atoms are in the first coordination shell, red atoms are in the second coordination shell and grey atoms are in the third coordination shell.]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing of FCC lattice of solid is the same as the radius of the second coordination shell and is equal to 1.475 (refer graph 11)&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The main result from the RDF is that the solid has short and long range order, the liquid has only short range order and the gas is completely disordered.  Good diagram of an fcc lattice to show the positions on the nearest neighbours.  Could you calculate the lattice spacing from the first and third peaks as well using the geometry of an fcc lattice and then average over them?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Section 7: Dynamic Properties and the Diffusion Coefficient ==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
====Task====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[File:Part 7 Diffusion hjt146.png|thumb|centre|500px|Graph 13]]&lt;br /&gt;
|&lt;br /&gt;
[[File:Part 7 Diffusion hjt14.png|thumb|centre|500px|Graph 14]]&lt;br /&gt;
|&lt;br /&gt;
{| class=&#039;wikitable&#039;&lt;br /&gt;
!State&lt;br /&gt;
!Gradient (w.r.t. time)&lt;br /&gt;
!Diffusion Coefficient (w.r.t. time)&lt;br /&gt;
|-&lt;br /&gt;
|Gas (million)&lt;br /&gt;
|18.19 (linear part)&lt;br /&gt;
|3.032&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|4.915&lt;br /&gt;
|0.8192&lt;br /&gt;
|-&lt;br /&gt;
|Liquid (million)&lt;br /&gt;
|0.5236&lt;br /&gt;
|0.08727&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|0.5094&lt;br /&gt;
|0.0849&lt;br /&gt;
|-&lt;br /&gt;
|Solid (million)&lt;br /&gt;
|0.00002635&lt;br /&gt;
|0.000004392&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.00535&lt;br /&gt;
|0.000892&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
From graph 13, it can be seen that the diffusion coefficients increase from solid to gas and these are expected. In solid, the particles are closely packed, to diffuse, solid particles have to overcome large repulsion when sliding pass other particles and this contribute to the large activation energy for diffusive motion. Hence solid has negligible diffusion coefficient due to large energy barrier.  From liquid to gas, the packing decreases meaning that the particles are further apart, making it easier for particle to move pass each other. The is reflected in the increase in diffusion coefficient when going from liquid to gas.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Plot lines of best fit on the graph as well, did you fit to the entire data range or just to the linear part?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
====Task====&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
x(t)= A \cos \left(\omega t+\phi \right) ;  v(t)=\frac{dx(t)}{dt}=-A \omega \sin\left(\omega t+ \phi \right)&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&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}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} A^2 \omega^2 \sin\left(\omega t+ \phi \right) \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}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{\int_{-\infty}^{\infty}A^2 \omega^2 \sin \left(\omega t+ \phi \right) \left( \sin \left( \omega t + \phi \right) \cos \omega \tau + \cos \left( \omega t + \phi \right) \sin \omega \tau \right)\mathrm{d}t }{\int_{-\infty}^{\infty} \frac {A^2 \omega^2}{2} \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{A^2 \omega^2\int_{-\infty}^{\infty} \sin^2 \left(\omega t+ \phi \right)  \cos \omega \tau  + \sin \left(\omega t+ \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \mathrm{d}t }{\frac {A^2 \omega^2}{2}\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{\int_{-\infty}^{\infty}\left(1-\cos \left( 2\omega t + 2 \phi\right) \right)  \cos \omega \tau  + 2\sin \left(\omega t+ \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \mathrm{d}t }{\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \frac{  \cos \omega \tau  \int_{-\infty}^{\infty}\left(1-\cos \left( 2\omega t + 2 \phi\right) \right) \mathrm{d}t }{\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
+ \frac{2\int_{-\infty}^{\infty}\sin \left(\omega t+ \phi \right) \cos \left( \omega t + \phi \right) \sin \omega \tau \mathrm{d}t }{\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \cos \omega \tau&lt;br /&gt;
+ \frac{2\sin \omega \tau \int_{-\infty}^{\infty}\sin \left(\omega t+ \phi \right) \cos \left( \omega t + \phi \right)  \mathrm{d}t }{\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \cos \omega \tau&lt;br /&gt;
+ \frac{\sin \omega \tau \left[\sin ^2\left(\omega t+ \phi \right) \right]_{-\infty}^{\infty} }{\int_{-\infty}^{\infty}  \left(1-\cos \left( 2\omega t + 2 \phi\right)\right) \mathrm{d}t}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second term goes to zero and then we are left with:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \cos \omega \tau&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the second integral go to zero?  An even function multiplied by an odd function is an odd function, and the integral of an odd function with limits equally spaced about zero is zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Section 7 VACF graph hjt14.png|thumb|500px|Graph 15]]&lt;br /&gt;
|[[File:Section 7 VACF and SHO.png|thumb|500px|Graph 16]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equation shown above projects velocity at &amp;lt;math&amp;gt; \left(t+\tau\right) &amp;lt;/math&amp;gt; onto velocity at &amp;lt;math&amp;gt; \left(t\right) &amp;lt;/math&amp;gt; and what we obtain is &amp;lt;math&amp;gt; C\left(\tau\right) &amp;lt;/math&amp;gt;, a number which quantifies the correlation between the two velocities. From gas to solid, the rate of decay of &amp;lt;math&amp;gt; C\left(\tau\right) &amp;lt;/math&amp;gt; increases and this is related to the rate of collision. In gas and liquid, particles collide with one another, however, in liquid, the frequency of collision is higher. Rapid exchange of energy between liquid particle causes a liquid particle to lost the initial velocity component at a faster rate than that of gas. From liquid to solid, the situation changes slightly. In a solid, unlike gas and liquid, the particles only vibrate about the equilibrium position. Because the motion of solid particle is confined within a small space, it correlate to initial velocity to a longer period of time. The minima in solid and liquid VACF vs time graph (see Graph 15 and Graph 16) is related to back scattering of particle after collision, hence the &amp;lt;math&amp;gt; C(\tau) &amp;lt;/math&amp;gt; is negative in sign (inverse of the initial course). &lt;br /&gt;
&lt;br /&gt;
In simple harmonic oscillator the particles are vibrating about an equilibrium position and there is no collision with another particle, therefore it retain the memory of the initial velocity throughout the simulation. The simple harmonic oscillator aims to illustrate that the velocity correlation in ideal system will continue for infinite amount of time. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Task====&lt;br /&gt;
{| class=&#039;wikitable&#039;&lt;br /&gt;
| [[File:Section 7 Running Int hjt14.png|thumb|500px|Graph 17]]&lt;br /&gt;
|&lt;br /&gt;
{|class=&#039;wikitable&#039;&lt;br /&gt;
|Phase&lt;br /&gt;
|Average value of plateau region of graph&lt;br /&gt;
|Diffusion Coefficient from VACF&lt;br /&gt;
|Diffusion Coefficient from MSD&lt;br /&gt;
|-&lt;br /&gt;
|Solid (million)&lt;br /&gt;
|0.000192943&lt;br /&gt;
|0.000064314&lt;br /&gt;
|0.000004392&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|0.00345&lt;br /&gt;
|0.00115&lt;br /&gt;
|0.000892&lt;br /&gt;
|-&lt;br /&gt;
|Liquid (million)&lt;br /&gt;
|0.25621&lt;br /&gt;
|0.08540&lt;br /&gt;
|0.08727&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|0.2316&lt;br /&gt;
|0.0772&lt;br /&gt;
|0.0849&lt;br /&gt;
|-&lt;br /&gt;
|Gas (million)&lt;br /&gt;
|9.8054&lt;br /&gt;
|3.2685&lt;br /&gt;
|3.032&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|2.44197&lt;br /&gt;
|0.81399&lt;br /&gt;
|0.8192&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients calculated using two different methods are in very close agreement and this is expected. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Source of error&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
According to following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&lt;br /&gt;
&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The integration range is &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt;. However in our calculation the integration was stopped at time&amp;lt;math&amp;gt; = 10 &amp;lt;/math&amp;gt;, and this could contribute to the error of data.  Another source of error is the integration method. By using trapezium rule, we are dividing the graph into different rectangular strips. However, the graph itself can not be be describe perfectly using rectangular strips and will eventually result in overestimation (strips bigger than graph) or underestimation (strips smaller graph).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Approximating the integral by reducing the range from infinity to 10 will cause a more significant error if the running integral hasn&#039;t fully plateaued by 10.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Modxl9814&amp;diff=585926</id>
		<title>Talk:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Modxl9814&amp;diff=585926"/>
		<updated>2017-02-21T05:05:33Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered, and results look good.  Make sure that you understand the background theory behind these questions and use it to explain your result, and that your explanations don&#039;t contradict what your results show.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&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(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good additional research, but a linear fit would have been sufficient here.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&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;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&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;\varepsilon=-\phi(r_{eq})&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; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&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=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&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=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth=&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
Giving atoms random starting coordinates may make two atoms generated too close together. This will cause the two atoms to collide and arise the repulsion between the two atoms. The repulsive force between the atoms will drive them apart, leading to increase in the potential energy of the system and making it very unstable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces can cause the simulation to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 lattice points per unit cell. The side length of the cubic unit cell=&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If 1000 unit cells were generated by the create_atoms command, 4000 atoms would be generated for a FCC lattice.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Mass 1 1.0&amp;lt;/pre&amp;gt; &lt;br /&gt;
This means the mass of the single type of atom is 1.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;Pair_style&amp;quot; indicates that the interaction is pairwise interaction. &amp;quot;lj.cut&amp;quot; describes the standard 12/6 Lennard-Jones potential without a Coulombic pairwise interaction. &amp;quot;3.0&amp;quot; indicates that the global cutoff for atoms is at 3.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_coeff * *1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; specifies the pairwise force field coefficients. The two asterisks indicate that the command will apply to all atoms.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt;are specified,the Velocity-Verlet algorithm will be used for this simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do we use a cutoff?  What are the forcefield coefficients in your simulations, considering that you are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
The purpose of defining variable is that we don&#039;t need to manually change the numerical timestep each time the timestep needs to be changed. This reduces the human errors that may occur as the timestep only needs to be changed once to the value defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Using variables means that all commands in the simulation that depend on a certain value, like the timestep in this case, are updated automatically when that value is changed.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 4a1.PNG|450px|thumb|left|Fig 4a:Total energy vs. time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4b1.PNG|450px|thumb|center|Fig 4b: Temperature vs Time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4c1.PNG|450px|thumb|right|Fig 4c: Pressure vs. Time at 0.001 timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium at 0.001 timestep as pressure and temperature become constant. It can be seen from pressure and temperature data that the simulation reaches equilibrium at t=0.29.The average pressure value is about 2.61 and the average temperature value is about 1.26.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 4d.PNG|500px|thumb|center|Fig.5: Graph of energies for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig 5 that the total energy produced by 0.0025 timestep are very close to those produced by 0.001 timestep. Simulations at 0.0075 and 0.01 also reach equilibrium but the total energies are higher than those produced by 0.001 timestep, thus these timesteps are not very accurate. Therefore the largest timestep to get acceptable results is 0.0025 and the worst choice is 0.015 timestep as the simulation doesn&#039;t reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, average energy should not depend on the timestep, making timesteps above 0.0025 poor choices.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Barostat and Thermostat===&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&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{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{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;\gamma^2 = \frac{\mathfrak{T}}{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; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
The numbers 100 1000 100000 indicate the timesteps the input values will be used to compute the averages of density, pressure and temperature. For this simulation, the average will be calculated using values produced by timestep 100,200,...100000. Therefore, 1000 values will be used to calculate the average. The following line tells LAMMPS to run the simulation for 100000 timesteps. 0.0025 timestep will be used. Therefore 250 time units are simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific about what each of the three numbers refers to.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 5a.PNG|450px|thumb|left|Fig.6:Density vs Temperature and Ideal Gas law at p=2.3 and p=2.6]]&lt;br /&gt;
|[[File:Fig 6b.PNG|450px|thumb|left|Fig.7:Density calculated by Ideal Gas Law compared to LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, how does the difference between the ideal gas and siulation results change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 4&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;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press atoms density vol&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 volume equal vol&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 N2 equal atoms*atoms&lt;br /&gt;
variable E2 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_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/f_aves[5]&lt;br /&gt;
variable CV equal ${heatcapacity}/${volume}&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity/volume: ${CV}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8a3.PNG|500px|thumb|center|Fig.8: Cv/V vs. temperature at densities 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature. The volume for &amp;lt;math&amp;gt;\rho=0.2&amp;lt;/math&amp;gt; is 16875. The volume for &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; is 4218.75. The heat capacity is inversely proportional to temperature from Fig.8, the same as shown in the equation &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;. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The heat capacity is not necessarily inversely proportional to temperature because &amp;lt;E&amp;gt; and &amp;lt;E^2&amp;gt; are also dependent on temperature. You say that at higher density less heat is needed to raise the temperature which should mean the heat capacity is smaller, this is not what your results show.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8.PNG|500px|thumb|left|Fig.9: g(r) vs. r for solid, liquid and gaseous phases ]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1.6&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: More peaks don&#039;t indicate a higher density, the RDFs are normalised - they all tend to 1 - and so you cannot tell which has a higher density.  The RDF just indicates order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1010.PNG|500px|thumb|center|Fig.10: Integral of g(r) vs. interatomic distance for solid phase ]]&lt;br /&gt;
&lt;br /&gt;
The coordination number for the first three peaks can be calculated from the plot of the integral of g(r) against interatomic distance. The integral of g(r) at the inflection points represent the coordination number of the three nearest neighbors. As a FCC lattice is used in a solid system, there should be 12 neighboring particles around each particle (shown at r=1.275). So the coordination number of the first peak is 12.  The next inflection number has a g(r) integral of 18. As it is a running integral, the coordination number of the second peak is &amp;lt;math&amp;gt;18-12=6&amp;lt;/math&amp;gt;. The coordination number of the third peak is &amp;lt;math&amp;gt;42-18=24&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It would have been good to show on a diagram of an fcc lattice which atoms are responsible for the first 3 peaks.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
The mean squared displacement is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\displaystyle {\rm {MSD}}\equiv \langle (x-x_{0})^{2}\rangle ={\frac {1}{N}}\sum _{n=1}^{N}(x_{n}(t)-x_{n}(0))^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a1.PNG|450px|thumb|left|Fig 11a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 11a.PNG|450px|thumb|left|Fig 11b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12a.PNG|450px|thumb|left|Fig 11c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a.PNG|450px|thumb|left|Fig 12a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 10b.PNG|450px|thumb|left|Fig 12b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12b.PNG|450px|thumb|left|Fig 12c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All these plots are as expected. For the liquid phase, MSD is directly proportional to timestep, this is because the particles move in brownian motion. Foe gaseous phase, the first part (timestep 0-2000) is curved and the second part (above 2000) is linear. The curved part is because the particles move randomly in the system and the distance between them is very large. The frequency of collision between the particles is very low and thus the velocity of the atoms will be almost constant. The distance travelled per unit time is constant, thus MSD is proportional to &amp;lt;math&amp;gt;t^2&amp;lt;/math&amp;gt;. As longer time is simulated, collisions will occur more frequently and the motion can be described by brownian motion and MSD changes linearly with timestep. For solid phase, the particles only vibrate in fixed positions and do not have enough kinetic energy to diffuse, thus MSD reaches at constant value at around timestep 200.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The curved part of the gas plot is due to balistic motion, not because the particles move randomly.  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta t=0.002&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For small system of 3375 atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0245}{0.002}=2.042&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For large system of 1 million atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0305}{0.002}=2.542&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All of the diffusion coefficients are in reduced units. The coefficients for the larger system were similar to the ones for the smaller system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
The equation of the position of a 1D harmonic oscillator is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t) = A\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}&amp;lt;/math&amp;gt;, thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = \frac{d(Acos(\omega t +\phi)}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-A\omega sin(\omega(t + \tau) +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} v(t)v(t + \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}= \frac{\int_{-\infty}^{\infty} -A\omega sin(\omega t+ \phi) \times -A\omega sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega sin(\omega t+\phi))^2\mathrm{d}t}=\frac{(A\omega)^2 \int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{(A\omega)^2 \int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)[sin(\omega t+ \phi)cos(\omega \tau)+cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{cos(\omega \tau)\int_{-\infty}^{\infty}sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t} = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(2x)=2sin(x)cos(x)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty} \frac{1}{2}sin(2(\omega t+ \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;sin(x)&amp;lt;/math&amp;gt; is an odd function, the area above the x-axis and below the x-axis cancel out from negative infinity to positive infinity. Thus, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(2(\omega t+\phi))=0&amp;lt;/math&amp;gt;. therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice clear derivation and well spotted that you can simplify the integrals.  cos*sin is also an odd function (even x odd = odd) so you don&#039;t need to change this to sin(2x).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 13.PNG|500px|thumb|center|Fig.14: VACF for solid, liquid and 1D Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF for the liquid system represent the collisions between the atoms and the solvent molecules and change in direction. The minima in the VACF for the solid system represent the collisions between the atoms and change in direction. The minima for the solid system is lower than the minima for the liquid system because of the stronger interatomic forces. The VACF for the liquid system only has one weak oscillation, this is because the atoms only interact with their closest neighbor. In the VACF for the solid system, there are more oscillations as the atoms can vibrate in fixed positions. The harmonic oscillator VACF is very different to the Lennard Jones liquid and solid as there are no interactions between the atoms so the atoms will always vibrate with constant velocity without loss in energy. Therefore, the amplitude doe not change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There is not only one collision in the liquid, but the first collision randomises the particle velocities and the VACF decays to zero more quickly than in a solid.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By applying the trapezium rule, integral under VACF can be calculated and running integral can be plotted:&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 15a1.PNG|450px|thumb|left|Fig.15a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 15b1.PNG|450px|thumb|left|Fig.15b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 15c.PNG|450px|thumb|left|Fig.15c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 16a1.PNG|450px|thumb|left|Fig.16a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 16b1.PNG|450px|thumb|left|Fig.16b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 16c.PNG|450px|thumb|left|Fig.16c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last point of the running integral is &amp;lt;math&amp;gt;\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2937=9.79 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 5.64 \times 10^{-4}=1.88 \times 10{-4}&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 7.054=2.351&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2703=9.01 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 1.37 \times 10^{-4}=4.57 \times 10^{-5} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 9.805=3.268&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient calculated from this method was largest for gas, followed by liquid and then gas. The coefficients for the larger system were very similar to the ones for the smaller system. The coefficients calculated by MSD were similar to the ones calculated by VACF for liquid and gas, but the coefficient calculated by VACF was larger than the one calculated by MSD for solid. The largest source of error may be that the trapezium rule overestimates the area under the solid curve as the timestep is not small enough.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The trapezium rule is a source of error, but does it definitely overestimate the integral?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Modxl9814&amp;diff=585925</id>
		<title>Talk:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Modxl9814&amp;diff=585925"/>
		<updated>2017-02-21T05:02:49Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered, but try .  Make sure that your explanations support what your results show and don&amp;#039;t contradict them.&amp;lt;/spa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered, but try .  Make sure that your explanations support what your results show and don&#039;t contradict them.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&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(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good additional research, but a linear fit would have been sufficient here.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&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;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&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;\varepsilon=-\phi(r_{eq})&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; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&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=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&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=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth=&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All calculations correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
Giving atoms random starting coordinates may make two atoms generated too close together. This will cause the two atoms to collide and arise the repulsion between the two atoms. The repulsive force between the atoms will drive them apart, leading to increase in the potential energy of the system and making it very unstable.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: High repulsive forces can cause the simulation to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 lattice points per unit cell. The side length of the cubic unit cell=&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If 1000 unit cells were generated by the create_atoms command, 4000 atoms would be generated for a FCC lattice.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Mass 1 1.0&amp;lt;/pre&amp;gt; &lt;br /&gt;
This means the mass of the single type of atom is 1.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;Pair_style&amp;quot; indicates that the interaction is pairwise interaction. &amp;quot;lj.cut&amp;quot; describes the standard 12/6 Lennard-Jones potential without a Coulombic pairwise interaction. &amp;quot;3.0&amp;quot; indicates that the global cutoff for atoms is at 3.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_coeff * *1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; specifies the pairwise force field coefficients. The two asterisks indicate that the command will apply to all atoms.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt;are specified,the Velocity-Verlet algorithm will be used for this simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do we use a cutoff?  What are the forcefield coefficients in your simulations, considering that you are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
The purpose of defining variable is that we don&#039;t need to manually change the numerical timestep each time the timestep needs to be changed. This reduces the human errors that may occur as the timestep only needs to be changed once to the value defined.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Using variables means that all commands in the simulation that depend on a certain value, like the timestep in this case, are updated automatically when that value is changed.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 4a1.PNG|450px|thumb|left|Fig 4a:Total energy vs. time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4b1.PNG|450px|thumb|center|Fig 4b: Temperature vs Time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4c1.PNG|450px|thumb|right|Fig 4c: Pressure vs. Time at 0.001 timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium at 0.001 timestep as pressure and temperature become constant. It can be seen from pressure and temperature data that the simulation reaches equilibrium at t=0.29.The average pressure value is about 2.61 and the average temperature value is about 1.26.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 4d.PNG|500px|thumb|center|Fig.5: Graph of energies for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig 5 that the total energy produced by 0.0025 timestep are very close to those produced by 0.001 timestep. Simulations at 0.0075 and 0.01 also reach equilibrium but the total energies are higher than those produced by 0.001 timestep, thus these timesteps are not very accurate. Therefore the largest timestep to get acceptable results is 0.0025 and the worst choice is 0.015 timestep as the simulation doesn&#039;t reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, average energy should not depend on the timestep, making timesteps above 0.0025 poor choices.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Barostat and Thermostat===&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&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{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{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;\gamma^2 = \frac{\mathfrak{T}}{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; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
The numbers 100 1000 100000 indicate the timesteps the input values will be used to compute the averages of density, pressure and temperature. For this simulation, the average will be calculated using values produced by timestep 100,200,...100000. Therefore, 1000 values will be used to calculate the average. The following line tells LAMMPS to run the simulation for 100000 timesteps. 0.0025 timestep will be used. Therefore 250 time units are simulated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Be more specific about what each of the three numbers refers to.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 5a.PNG|450px|thumb|left|Fig.6:Density vs Temperature and Ideal Gas law at p=2.3 and p=2.6]]&lt;br /&gt;
|[[File:Fig 6b.PNG|450px|thumb|left|Fig.7:Density calculated by Ideal Gas Law compared to LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, how does the difference between the ideal gas and siulation results change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&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 4&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;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press atoms density vol&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 volume equal vol&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 N2 equal atoms*atoms&lt;br /&gt;
variable E2 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_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/f_aves[5]&lt;br /&gt;
variable CV equal ${heatcapacity}/${volume}&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity/volume: ${CV}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8a3.PNG|500px|thumb|center|Fig.8: Cv/V vs. temperature at densities 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature. The volume for &amp;lt;math&amp;gt;\rho=0.2&amp;lt;/math&amp;gt; is 16875. The volume for &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; is 4218.75. The heat capacity is inversely proportional to temperature from Fig.8, the same as shown in the equation &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;. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The heat capacity is not necessarily inversely proportional to temperature because &amp;lt;E&amp;gt; and &amp;lt;E^2&amp;gt; are also dependent on temperature. You say that at higher density less heat is needed to raise the temperature which should mean the heat capacity is smaller, this is not what your results show.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8.PNG|500px|thumb|left|Fig.9: g(r) vs. r for solid, liquid and gaseous phases ]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1.6&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: More peaks don&#039;t indicate a higher density, the RDFs are normalised - they all tend to 1 - and so you cannot tell which has a higher density.  The RDF just indicates order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1010.PNG|500px|thumb|center|Fig.10: Integral of g(r) vs. interatomic distance for solid phase ]]&lt;br /&gt;
&lt;br /&gt;
The coordination number for the first three peaks can be calculated from the plot of the integral of g(r) against interatomic distance. The integral of g(r) at the inflection points represent the coordination number of the three nearest neighbors. As a FCC lattice is used in a solid system, there should be 12 neighboring particles around each particle (shown at r=1.275). So the coordination number of the first peak is 12.  The next inflection number has a g(r) integral of 18. As it is a running integral, the coordination number of the second peak is &amp;lt;math&amp;gt;18-12=6&amp;lt;/math&amp;gt;. The coordination number of the third peak is &amp;lt;math&amp;gt;42-18=24&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It would have been good to show on a diagram of an fcc lattice which atoms are responsible for the first 3 peaks.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
The mean squared displacement is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\displaystyle {\rm {MSD}}\equiv \langle (x-x_{0})^{2}\rangle ={\frac {1}{N}}\sum _{n=1}^{N}(x_{n}(t)-x_{n}(0))^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a1.PNG|450px|thumb|left|Fig 11a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 11a.PNG|450px|thumb|left|Fig 11b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12a.PNG|450px|thumb|left|Fig 11c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a.PNG|450px|thumb|left|Fig 12a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 10b.PNG|450px|thumb|left|Fig 12b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12b.PNG|450px|thumb|left|Fig 12c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All these plots are as expected. For the liquid phase, MSD is directly proportional to timestep, this is because the particles move in brownian motion. Foe gaseous phase, the first part (timestep 0-2000) is curved and the second part (above 2000) is linear. The curved part is because the particles move randomly in the system and the distance between them is very large. The frequency of collision between the particles is very low and thus the velocity of the atoms will be almost constant. The distance travelled per unit time is constant, thus MSD is proportional to &amp;lt;math&amp;gt;t^2&amp;lt;/math&amp;gt;. As longer time is simulated, collisions will occur more frequently and the motion can be described by brownian motion and MSD changes linearly with timestep. For solid phase, the particles only vibrate in fixed positions and do not have enough kinetic energy to diffuse, thus MSD reaches at constant value at around timestep 200.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The curved part of the gas plot is due to balistic motion, not because the particles move randomly.  Show the lines of best fit on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta t=0.002&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For small system of 3375 atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0245}{0.002}=2.042&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For large system of 1 million atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0305}{0.002}=2.542&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All of the diffusion coefficients are in reduced units. The coefficients for the larger system were similar to the ones for the smaller system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
The equation of the position of a 1D harmonic oscillator is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t) = A\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}&amp;lt;/math&amp;gt;, thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = \frac{d(Acos(\omega t +\phi)}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-A\omega sin(\omega(t + \tau) +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} v(t)v(t + \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}= \frac{\int_{-\infty}^{\infty} -A\omega sin(\omega t+ \phi) \times -A\omega sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega sin(\omega t+\phi))^2\mathrm{d}t}=\frac{(A\omega)^2 \int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{(A\omega)^2 \int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)[sin(\omega t+ \phi)cos(\omega \tau)+cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{cos(\omega \tau)\int_{-\infty}^{\infty}sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t} = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(2x)=2sin(x)cos(x)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty} \frac{1}{2}sin(2(\omega t+ \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;sin(x)&amp;lt;/math&amp;gt; is an odd function, the area above the x-axis and below the x-axis cancel out from negative infinity to positive infinity. Thus, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(2(\omega t+\phi))=0&amp;lt;/math&amp;gt;. therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice clear derivation and well spotted that you can simplify the integrals.  cos*sin is also an odd function (even x odd = odd) so you don&#039;t need to change this to sin(2x).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 13.PNG|500px|thumb|center|Fig.14: VACF for solid, liquid and 1D Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF for the liquid system represent the collisions between the atoms and the solvent molecules and change in direction. The minima in the VACF for the solid system represent the collisions between the atoms and change in direction. The minima for the solid system is lower than the minima for the liquid system because of the stronger interatomic forces. The VACF for the liquid system only has one weak oscillation, this is because the atoms only interact with their closest neighbor. In the VACF for the solid system, there are more oscillations as the atoms can vibrate in fixed positions. The harmonic oscillator VACF is very different to the Lennard Jones liquid and solid as there are no interactions between the atoms so the atoms will always vibrate with constant velocity without loss in energy. Therefore, the amplitude doe not change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There is not only one collision in the liquid, but the first collision randomises the particle velocities and the VACF decays to zero more quickly than in a solid.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By applying the trapezium rule, integral under VACF can be calculated and running integral can be plotted:&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 15a1.PNG|450px|thumb|left|Fig.15a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 15b1.PNG|450px|thumb|left|Fig.15b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 15c.PNG|450px|thumb|left|Fig.15c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 16a1.PNG|450px|thumb|left|Fig.16a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 16b1.PNG|450px|thumb|left|Fig.16b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 16c.PNG|450px|thumb|left|Fig.16c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last point of the running integral is &amp;lt;math&amp;gt;\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2937=9.79 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 5.64 \times 10^{-4}=1.88 \times 10{-4}&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 7.054=2.351&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2703=9.01 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 1.37 \times 10^{-4}=4.57 \times 10^{-5} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 9.805=3.268&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient calculated from this method was largest for gas, followed by liquid and then gas. The coefficients for the larger system were very similar to the ones for the smaller system. The coefficients calculated by MSD were similar to the ones calculated by VACF for liquid and gas, but the coefficient calculated by VACF was larger than the one calculated by MSD for solid. The largest source of error may be that the trapezium rule overestimates the area under the solid curve as the timestep is not small enough.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The trapezium rule is a source of error, but does it definitely overestimate the integral?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ym28142814&amp;diff=585924</id>
		<title>Talk:Mod:ym28142814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ym28142814&amp;diff=585924"/>
		<updated>2017-02-21T03:43:19Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Most tasks answered, but some detail missing, especially in the explanations of what your results show and why.  Try to answer the tasks more thoroughly and discuss the trends in your data and whether this is what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
The velocity-Verlet solution for the position at time t is calculated by the equation below where timestep is 0.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) = \mathbf{x}_i\left(t\right) + \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right)\delta t \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is calculatd by  &amp;lt;math&amp;gt; x(t) = A\cos(\omega t + \phi)&amp;lt;/math&amp;gt;. In this case, &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;=1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;=0.00 and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;=1.00.&lt;br /&gt;
&lt;br /&gt;
[[File:analytical solution.png|550x550px|thumb|center|Figure 1:classical solution and velocity-Verlet solution for the position at time t]]&lt;br /&gt;
The plot above shows a comparison between the classical solution and velocity-Verlet solution and it can be seen that there are no significant differences between two solutions.&lt;br /&gt;
&lt;br /&gt;
The graph below shows the actual difference between the two solutions.&lt;br /&gt;
[[File:Maxima in error myj.png|550x550px|thumb|center|Figure 2:absolute difference between &amp;quot;ANALYTICAL&amp;quot; and velocity-Verlet solution]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima in error are estimated and shown as a function of time (brown line), which can be fit to the equation shown in the graph.&lt;br /&gt;
The total energy of the oscillator is the sum of kinetic and potential energies: &amp;lt;math&amp;gt;E=\frac{mv^2}{2} + \frac{kx^2}{2}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; are the velocity-Verlet solution for velocity and position (&amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;=1.00 and &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;=1.00).&lt;br /&gt;
&lt;br /&gt;
[[File:total_energy_myj.png|550x550px|thumb|center|Figure 3:total energy and its lower and upper limit when timestep is 0.1]]&lt;br /&gt;
[[File:energy_0.2timestep_myj.png|550x550px|thumb|center|Figure 4:total energy and its lower and upper limit when timestep is 0.2]]&lt;br /&gt;
&lt;br /&gt;
In order to make sure the total energy does not change by more than 1%, timestep should be no more than 0.2. In a simple harmonic oscillator, the sum of kinetic energy and potential energy should ideally be constant, so it is important to monitor the total energy of a physical system when modeling its behaviour numerically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
For a single Lennard-Jones interaction, the potential energy can be calculated by &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;. When the potential energy is zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is equal to the value of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; (&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;).&lt;br /&gt;
The force acting on an object is determined by the potential that it experiences:&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \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;
So the force at this seperation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; can be calculated as below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i =- \frac{\mathrm{d}\phi\left(r_i\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&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} =- \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Since &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12r_0^{12}}{r_0^{13}} + \frac{6r_0^6}{r_0^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the force at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; can be simplified to :&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation can be found when the force is equal to zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; can be calculated as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon= -\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int\phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; can be simplyfied as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int\phi\left(r\right)\mathrm{d}r = -4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 2^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times2^5\times\sigma^6} \right)=-2.48\times10^{-2}&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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 2.5^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times2.5^5\times\sigma^6} \right)=-8.18\times10^{-3}&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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 3^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times3^5\times\sigma^6} \right)=-3.29\times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and nicely laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
Mass of one water molecule can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;m=\frac{MW}{N_A}=2.99\times10^{-23}g&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\rho=\frac{m}{V}&amp;lt;/math&amp;gt; and the density of water is &amp;lt;math&amp;gt;1 g/cm^{-3}&amp;lt;/math&amp;gt;under standard consitions, the volume of 10000 water molecule can be estimated as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;V=\frac{m}{\rho}=\frac{10000\times2.99\times10^{-23}}{1}=2.99\times10^{-19}cm^3&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a single timestep, an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;, the final position is &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;. After applying periodic boundary conditions, the final position is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
Since &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}=3.2&amp;lt;/math&amp;gt;, in real unit &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r=r^*\sigma=0.34\times3.2=1.09 nm&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;,  the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt; can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon=1.38\times10^{-23}\times120\times10^{-3}\times6.02\times10^{23}=0.997\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;, the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T=\frac{T^*\epsilon}{k_B}=1.5\times120=180 K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Output of First Simulations==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
Generating random starting coordinates for atoms causes problems in simulations because if two atoms happen to be generated close together, the force between two will be large and the resulting potential energy will be high as well, which makes the system unstable. Therefore the final results of simulation will be inaccurate.&lt;br /&gt;
&lt;br /&gt;
In the output file, a simple cubic lattice is created and the distance between the points of this lattice is 1.07722 (in reduced units).&lt;br /&gt;
&amp;lt;center&amp;gt;lattice point number density = number of lattice point/volume of lattice&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{1}{1.07722^3}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case of fcc cubic lattice, the number of lattice points is 4. &lt;br /&gt;
Since the lattice point number density is 1.2 in this case, the side length can be calculated:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; l=\sqrt[3]{\frac{4}{1.2}}=1.5&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 unit cells will be created by the create_atoms command and therefore 4000 atoms will be created for the fcc cubic lattice.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is only one atom type and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
The pairwise interaction is set as cutoff Lennard-Jones potential with no Coulomb and the cutoff for atoms is at 3.0.&lt;br /&gt;
&lt;br /&gt;
pair_coeff specifies the pairwise force field coefficients for one or more pairs of atom types and the asterisks mean all atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do we use a cutoff for the potential?  What are the force field coefficients in this case, considering that we are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt; are being specified, so velocity Verlet Algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
It will be better to replace the text string with a value needed rather than define it directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This doesn&#039;t make sense.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:TE 0.001 myj.png|400px|thumb|Figure 5: Total energy against time for 0.001 timestep]]||[[File:T 0.001 myj.png|400px|thumb|Figure 6: Temperature against time for 0.001 timestep]]&lt;br /&gt;
||[[File:P 0.001 myj.png|400px|thumb|Figure 7: Pressure against time for 0.001 timestep]]&lt;br /&gt;
|}&lt;br /&gt;
The simulation reaches equilibrium at about t=0.3 and the total energy at equilibrium is about -3.18(in reduced unit).&lt;br /&gt;
&lt;br /&gt;
The pressure and temperature of the system also reach a constant average value with fluctuations, which is 2.6 and 1.3 respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Energy plot for comparision myj.png|600px|thumb|center|Figure 8: energy versus time for all of the timesteps]]&lt;br /&gt;
&lt;br /&gt;
Of the five timesteps used, 0.0025 is the largest to give acceptable results. It gives the most similar results as 0.001 timestep.&lt;br /&gt;
0.015 is a particularly bad choice because the simulation does not reach an equilibrium and the total energy keeps increasing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give a bit more detail.  Total energy should not depend on choice of timestep and 0.0025 is the largest timestep for which this is the case.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Temperature and Pressure Control==&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms each with 3 degrees of freedom:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to get our target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, every velocity can be multiplied by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i\gamma)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation can be simplified as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Nevery, Nrepeat, and Nfreq arguments (100, 1000, 10000 in this case) specify on what timesteps the input values will be used in order to contribute to the average. The final averaged quantities are generated on timesteps that are a multiple of Nfreq. The average is over Nrepeat quantities, computed in the preceding portion of the simulation every Nevery timesteps.&lt;br /&gt;
&lt;br /&gt;
The values will be sampled for the average every 100 timesteps and there are 1000 measurements contribute to the average.Then values on timesteps 100, 200, ... 100000 will be used to compute the final average on timestep 100000.&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation is run over 100000 timesteps, so the total time of simulation should be 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
10 simulations was run at 5 different temperatures (T=2.0, 3.0, 4.0, 5.0, 6.0) and 2 different pressures (P=2.6, 3.0) at 0.0025 timestep as it shows the best results in last section.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law shows &amp;lt;math&amp;gt;PV=Nk_BT&amp;lt;/math&amp;gt;, which can be used to calculate density as the equation showing below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since all variables are in reduced units after simulation and &amp;lt;math&amp;gt;P^*=\frac{P\sigma^3}{\epsilon}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\rho=\frac{N\sigma^3}{V}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T^*=\frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;1.4767528&amp;quot;&amp;gt;S. Delage Santacreu ,G. Galliero, M. Odunlami and C. Boned, &amp;quot;Low density shear viscosity of Lennard-Jones chains of variable rigidities&amp;quot;, &#039;&#039;J. Chem. Phys.&#039;&#039;, &#039;&#039;&#039;137&#039;&#039;&#039;, 204306(2012). {{DOI|10.1063/1.4767528}}&amp;lt;/ref&amp;gt;, the density predicted by ideal gas law can be calculated as below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho^*=\frac{\sigma^3N}{V}=\frac{\sigma^3P}{k_BT}=\frac{\sigma^3\frac{P^*\epsilon}{\sigma^3}}{T^*\epsilon}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Final myj.PNG|650px|center|thumb|Figure 9:density vs time for both of the pressures]]&lt;br /&gt;
&lt;br /&gt;
From the graph, it can be seen that the simulated density is lower than the ideal density and the discrepancy increases as pressure increases and it decreases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You need to explain why you see these trends.  What is the difference between your simulations and an ideal gas and how does that result in the trends that you see?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be calculated by the equation showing below:&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the temperatures and densities used are 2.0,2.2,2.4,2.6,2.8 and 0.2, 0.8 respectively.&lt;br /&gt;
&lt;br /&gt;
One of the input scripts is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable dens equal 0.2&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${dens}&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 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;
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;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp vol atoms&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable atoms2 equal atoms*atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_volume v_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable heatcapacity equal ${atoms2}*(f_aves[5]-f_aves[4]*f_aves[4])/f_aves[2]&lt;br /&gt;
variable heatcapacityV equal ${heatcapacity}/${volume}&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity over V: ${heatcapacityV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to make the heat capacity independent of the size, we plot &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; against temperature.&lt;br /&gt;
&lt;br /&gt;
[[file:HC myj.PNG|600px|thumb|center|figure 10: Cv/V against temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
According to the equation, the temperature and heat capacity are inversely proportional. So the value of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; should decrease with temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The numerator in the heat capacity equation (&amp;lt;E&amp;gt; and &amp;lt;E^2&amp;gt;) also depends on temperature so you would have to consider this dependence as well.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As for a larger density system, it will have more atoms at a fixed volume and the ability of it to store internal energy will be stronger, therefore the value of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; will be higher than at&amp;lt;math&amp;gt;\rho=0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
An atomic trajectory is recorded to generate RDFs for the solid, liquid, and vapour phase Lennard Jones systems. &lt;br /&gt;
In order to get 3 different phases, the density and temperature is modified as below &amp;lt;ref name=&amp;quot;PhysRev.184.151&amp;quot;&amp;gt;Jean-Pierre Hansen and Loup Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! vapour&lt;br /&gt;
! liquid&lt;br /&gt;
! solid&lt;br /&gt;
|-&lt;br /&gt;
| Temperature&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
| Density&lt;br /&gt;
| 0.05&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:Capture gr myj.PNG‎|500px|thumb|center|Figure 11: RDFs for 3 systems]]&lt;br /&gt;
&lt;br /&gt;
The RDF[https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions] defines the probability of finding a particle at a distance r from another particle. For all 3 systems, when r is small, the value of g(r) is zero as two particles can not occupy the same space due to repulsion forces and the first coordination sphere is found when &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Gases do not have a regular structure and only have one coordination sphere that will rapidly decay to normal density, g(r)=1.&lt;br /&gt;
&lt;br /&gt;
Solids have regular and specific structure over a long range. The peaks indicate the coordination shells for the solid. The first peak represents the nearest neighbours, the second peaks is for the second nearest neighbours and so on. There is no possibility to find particles in between as all molecules are regularly packed.&lt;br /&gt;
&lt;br /&gt;
Liquids are more loosely packed than solids, therefore, do not have exact intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Atoms in a liquid are not on a lattice so no long range order, but they do have short range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gr of solid.PNG|400px|thumb|Figure 12:first 3 peaks in RDF of solid]]||[[File:Integral of solid.PNG|400px|thumb|Figure 13: running integral of RDF of solid]]&lt;br /&gt;
|}&lt;br /&gt;
Acoording to the plot above, as for solid, the coordination number of the first coordination shell is 12. And the coordination number for the second and third shell is 6 and 24 respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Are these coordination numbers what you would expect?  Can you identify the atoms responsible for the first, second and third peaks on an fcc structure?  A diagram here would be good.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
The densities and temperatures used are the same as last section.&lt;br /&gt;
The graphs below show the simulation of MSD of liquid, solid and gas as well as for a 1 million atoms system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Vapour small myj.PNG|400px|thumb|Figure 14a: Simulation for gas]]||[[File:Liquid myj.PNG|400px|thumb|Figure 14b: simulation for liquid]]&lt;br /&gt;
||[[File:Solid small myj.PNG|400px|thumb|Figure 14c:simulation for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Vapour large myj.PNG|400px|thumb|Figure 15a: Simulation for gas (much larger system)]]||[[File:Liquid msd myj.PNG|400px|thumb|Figure 15b: simulation for liquid (much larger system)]]&lt;br /&gt;
||[[File:Solid large myj.PNG|400px|thumb|Figure 15c: Simulation for solid (much larger system)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graphs vapour and liquid for both small and large scales are nearly the same.&lt;br /&gt;
The graph for solid at a small scale looks similar to the larger system one but with more fluctuations because the stability of a system containing 1 million atoms would be much higher.&lt;br /&gt;
&lt;br /&gt;
Solid shows a completely different shape due to its regular structure and it has a fixed position for each atom (with vibrations).&lt;br /&gt;
&lt;br /&gt;
The value of D can be estimated by the equation showing below:&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;=gradient of trend line /timestep.&lt;br /&gt;
&lt;br /&gt;
As for small systems,&lt;br /&gt;
&lt;br /&gt;
vapour: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.0289}{0.002}=2.408&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{6\times10^{-9}}{0.002}=5\times10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for larger systems,&lt;br /&gt;
&lt;br /&gt;
vapour: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.0305}{0.002}=2.542&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{5\times10^{-8}}{0.002}=4.17\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This equation for the diffusion coefficient is only valid when the MSD graph is linear, so you should only fit the linear part of the graph to a straight line and calculate the gradient, don&#039;t use the whole data.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;v(t)=\frac{dx(t)}{dt}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t)=\frac {d[Acos(\omega t+\phi)]}{dt}=-\omega A sin(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-\omega A sin[\omega(t+ \tau)+\phi=-\omega A sin[\omega(t+\phi)+\omega \tau]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Acoording to the trigonometric formula &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-\omega A[sin(\omega t+\phi) cos(\omega \tau)+cos(\omega t +\phi) sin(\omega \tau)]=cos(\omega \tau)\times v(t)-\omega t[cos(\omega t+\phi) sin(\omega \tau)]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &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;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}v(t)[v(t) cos(\omega \tau)-\omega t[cos(\omega t+\phi)sin(\omega \tau)]]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) =\frac{cos(\omega t)\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}-\frac{\int_{-\infty}^{\infty} -\omega t[cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = cos(\omega t) -\frac{\int_{-\infty}^{\infty} -\omega t[cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sine function is an odd function, which means the integral of it from &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt; will be zero. Therefore the second part of the equation shown above should also be zero.&lt;br /&gt;
&lt;br /&gt;
Then the equation can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) =cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You have the right method, but there is a mistake in your working.  The final integral should be cos(omega*t+phi)*sin(omega*t+phi) which is an odd function and so the integral is zero.  In your working, you have the integral of cos(omega*t+phi) which is an even function.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The graph below shows the difference between VACFs of Lennard Jones liquid and solid and harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:Capacity myj.PNG|600px|thumb|center|Figure 16: VACFs for liquid, solid and &amp;lt;math&amp;gt;\omega=\frac{1}{2\pi}&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The velocity of a molecule after the collision will be independent of its initial velocity&amp;lt;ref name=&amp;quot;1.434461&amp;quot;&amp;gt;Otto J. Eder, &amp;quot;The velocity autocorrelation function and the diffusion coefficient for a dilute hard&lt;br /&gt;
sphere gas&amp;quot;, &#039;&#039;J. Chem. Phys.&#039;&#039;, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866 (1977).{{DOI|10.1063/1.434461}}&amp;lt;/ref&amp;gt;. Both magnitude and direction are expected to change with the influence of the force. The minimum value on the graph corresponds to the largest difference between final velocity and initial velocity. Solid has a lower value than the liquid due to stronger interatomic force. In the case of harmonic oscillator, the interatomic force is not involved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There are no collisions in the harmonic oscillator which is why it doesn&#039;t decay.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following equation can be used to calculate D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trapezium rule is then used to estimate the integrals under VACFs for gas, liquid and solid and the plots of running integral are shown below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gas s ri.PNG|400px|thumb|Figure 17a: running integral for gas]]||[[File:Liquid s ri.PNG|400px|thumb|Figure 17b: running integral for liquid]]&lt;br /&gt;
||[[File:Solid s ri.PNG|400px|thumb|Figure 17c: running integral for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As for larger systems:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gas l ri.PNG|400px|thumb|Figure 18a: running integral for gas]]||[[File:Liquid l ri.PNG|400px|thumb|Figure 18b: running integral for liquid]]&lt;br /&gt;
||[[File:Solid l ri.PNG|400px|thumb|Figure 18c: running integral for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Calculations for values of D for small systems:&lt;br /&gt;
&lt;br /&gt;
gas: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 9.27325499=3.091&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.293666634=0.098&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.002980073=9.933\times10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for larger systems:&lt;br /&gt;
&lt;br /&gt;
gas: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 9.805397393=3.268&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.270274429=0.090&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.000136588=4.553\times10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values of D obtained are very close to the values from the last section except for the value of solid.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule is not that accurate especially for solid and it can be improved by smaller timestep.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ym28142814&amp;diff=585923</id>
		<title>Talk:Mod:ym28142814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:ym28142814&amp;diff=585923"/>
		<updated>2017-02-21T03:36:37Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: .&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  ==Theory== ===Velocity Verlet Algorithm=== The velocity-Verlet solution for the position at time t is calculated...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: .&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
The velocity-Verlet solution for the position at time t is calculated by the equation below where timestep is 0.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) = \mathbf{x}_i\left(t\right) + \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right)\delta t \ \ &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is calculatd by  &amp;lt;math&amp;gt; x(t) = A\cos(\omega t + \phi)&amp;lt;/math&amp;gt;. In this case, &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;=1.00, &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt;=0.00 and &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;=1.00.&lt;br /&gt;
&lt;br /&gt;
[[File:analytical solution.png|550x550px|thumb|center|Figure 1:classical solution and velocity-Verlet solution for the position at time t]]&lt;br /&gt;
The plot above shows a comparison between the classical solution and velocity-Verlet solution and it can be seen that there are no significant differences between two solutions.&lt;br /&gt;
&lt;br /&gt;
The graph below shows the actual difference between the two solutions.&lt;br /&gt;
[[File:Maxima in error myj.png|550x550px|thumb|center|Figure 2:absolute difference between &amp;quot;ANALYTICAL&amp;quot; and velocity-Verlet solution]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The maxima in error are estimated and shown as a function of time (brown line), which can be fit to the equation shown in the graph.&lt;br /&gt;
The total energy of the oscillator is the sum of kinetic and potential energies: &amp;lt;math&amp;gt;E=\frac{mv^2}{2} + \frac{kx^2}{2}&amp;lt;/math&amp;gt;, where &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt;and &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; are the velocity-Verlet solution for velocity and position (&amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;=1.00 and &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;=1.00).&lt;br /&gt;
&lt;br /&gt;
[[File:total_energy_myj.png|550x550px|thumb|center|Figure 3:total energy and its lower and upper limit when timestep is 0.1]]&lt;br /&gt;
[[File:energy_0.2timestep_myj.png|550x550px|thumb|center|Figure 4:total energy and its lower and upper limit when timestep is 0.2]]&lt;br /&gt;
&lt;br /&gt;
In order to make sure the total energy does not change by more than 1%, timestep should be no more than 0.2. In a simple harmonic oscillator, the sum of kinetic energy and potential energy should ideally be constant, so it is important to monitor the total energy of a physical system when modeling its behaviour numerically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
For a single Lennard-Jones interaction, the potential energy can be calculated by &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;. When the potential energy is zero, the separation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; is equal to the value of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; (&amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;).&lt;br /&gt;
The force acting on an object is determined by the potential that it experiences:&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = - \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;
So the force at this seperation &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; can be calculated as below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i =- \frac{\mathrm{d}\phi\left(r_i\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&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} =- \frac{\mathrm{d}4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
Since &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12r_0^{12}}{r_0^{13}} + \frac{6r_0^6}{r_0^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the force at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; can be simplified to :&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =\frac{24\epsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation can be found when the force is equal to zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} =-4\epsilon \left( \frac{-12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right)=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right)&amp;lt;/math&amp;gt;, the well depth &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; can be calculated as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon= -\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int\phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; can be simplyfied as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int\phi\left(r\right)\mathrm{d}r = -4\epsilon \left( \frac{\sigma^{12}}{11r^{11}} - \frac{\sigma^6}{5r^5} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when &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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 2^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times2^5\times\sigma^6} \right)=-2.48\times10^{-2}&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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 2.5^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times2.5^5\times\sigma^6} \right)=-8.18\times10^{-3}&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 = 4\epsilon \left( \frac{\sigma^{12}}{11 \times 3^{11}\times\sigma^{12}} - \frac{\sigma^6}{5\times3^5\times\sigma^6} \right)=-3.29\times10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and nicely laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
Mass of one water molecule can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;m=\frac{MW}{N_A}=2.99\times10^{-23}g&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\rho=\frac{m}{V}&amp;lt;/math&amp;gt; and the density of water is &amp;lt;math&amp;gt;1 g/cm^{-3}&amp;lt;/math&amp;gt;under standard consitions, the volume of 10000 water molecule can be estimated as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;V=\frac{m}{\rho}=\frac{10000\times2.99\times10^{-23}}{1}=2.99\times10^{-19}cm^3&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a single timestep, an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;, the final position is &amp;lt;math&amp;gt;\left(1.2, 1.1, 0.7\right)&amp;lt;/math&amp;gt;. After applying periodic boundary conditions, the final position is &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
Since &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}=3.2&amp;lt;/math&amp;gt;, in real unit &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r=r^*\sigma=0.34\times3.2=1.09 nm&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;,  the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt; can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\epsilon=1.38\times10^{-23}\times120\times10^{-3}\times6.02\times10^{23}=0.997\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;, the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units can be calculated as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;T=\frac{T^*\epsilon}{k_B}=1.5\times120=180 K&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Output of First Simulations==&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
Generating random starting coordinates for atoms causes problems in simulations because if two atoms happen to be generated close together, the force between two will be large and the resulting potential energy will be high as well, which makes the system unstable. Therefore the final results of simulation will be inaccurate.&lt;br /&gt;
&lt;br /&gt;
In the output file, a simple cubic lattice is created and the distance between the points of this lattice is 1.07722 (in reduced units).&lt;br /&gt;
&amp;lt;center&amp;gt;lattice point number density = number of lattice point/volume of lattice&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{1}{1.07722^3}=0.8&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the case of fcc cubic lattice, the number of lattice points is 4. &lt;br /&gt;
Since the lattice point number density is 1.2 in this case, the side length can be calculated:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; l=\sqrt[3]{\frac{4}{1.2}}=1.5&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 unit cells will be created by the create_atoms command and therefore 4000 atoms will be created for the fcc cubic lattice.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is only one atom type and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
The pairwise interaction is set as cutoff Lennard-Jones potential with no Coulomb and the cutoff for atoms is at 3.0.&lt;br /&gt;
&lt;br /&gt;
pair_coeff specifies the pairwise force field coefficients for one or more pairs of atom types and the asterisks mean all atom types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do we use a cutoff for the potential?  What are the force field coefficients in this case, considering that we are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt; are being specified, so velocity Verlet Algorithm will be used.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
It will be better to replace the text string with a value needed rather than define it directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This doesn&#039;t make sense.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:TE 0.001 myj.png|400px|thumb|Figure 5: Total energy against time for 0.001 timestep]]||[[File:T 0.001 myj.png|400px|thumb|Figure 6: Temperature against time for 0.001 timestep]]&lt;br /&gt;
||[[File:P 0.001 myj.png|400px|thumb|Figure 7: Pressure against time for 0.001 timestep]]&lt;br /&gt;
|}&lt;br /&gt;
The simulation reaches equilibrium at about t=0.3 and the total energy at equilibrium is about -3.18(in reduced unit).&lt;br /&gt;
&lt;br /&gt;
The pressure and temperature of the system also reach a constant average value with fluctuations, which is 2.6 and 1.3 respectively.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Energy plot for comparision myj.png|600px|thumb|center|Figure 8: energy versus time for all of the timesteps]]&lt;br /&gt;
&lt;br /&gt;
Of the five timesteps used, 0.0025 is the largest to give acceptable results. It gives the most similar results as 0.001 timestep.&lt;br /&gt;
0.015 is a particularly bad choice because the simulation does not reach an equilibrium and the total energy keeps increasing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give a bit more detail.  Total energy should not depend on choice of timestep and 0.0025 is the largest timestep for which this is the case.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Temperature and Pressure Control==&lt;br /&gt;
===Thermostats and Barostats===&lt;br /&gt;
In our system with &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; atoms each with 3 degrees of freedom:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to get our target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;, every velocity can be multiplied by a constant factor &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i\gamma)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation can be simplified as below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Nevery, Nrepeat, and Nfreq arguments (100, 1000, 10000 in this case) specify on what timesteps the input values will be used in order to contribute to the average. The final averaged quantities are generated on timesteps that are a multiple of Nfreq. The average is over Nrepeat quantities, computed in the preceding portion of the simulation every Nevery timesteps.&lt;br /&gt;
&lt;br /&gt;
The values will be sampled for the average every 100 timesteps and there are 1000 measurements contribute to the average.Then values on timesteps 100, 200, ... 100000 will be used to compute the final average on timestep 100000.&lt;br /&gt;
&lt;br /&gt;
The timestep is 0.0025 and the simulation is run over 100000 timesteps, so the total time of simulation should be 250.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: God explanation.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
10 simulations was run at 5 different temperatures (T=2.0, 3.0, 4.0, 5.0, 6.0) and 2 different pressures (P=2.6, 3.0) at 0.0025 timestep as it shows the best results in last section.&lt;br /&gt;
&lt;br /&gt;
The ideal gas law shows &amp;lt;math&amp;gt;PV=Nk_BT&amp;lt;/math&amp;gt;, which can be used to calculate density as the equation showing below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since all variables are in reduced units after simulation and &amp;lt;math&amp;gt;P^*=\frac{P\sigma^3}{\epsilon}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\rho=\frac{N\sigma^3}{V}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;T^*=\frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;1.4767528&amp;quot;&amp;gt;S. Delage Santacreu ,G. Galliero, M. Odunlami and C. Boned, &amp;quot;Low density shear viscosity of Lennard-Jones chains of variable rigidities&amp;quot;, &#039;&#039;J. Chem. Phys.&#039;&#039;, &#039;&#039;&#039;137&#039;&#039;&#039;, 204306(2012). {{DOI|10.1063/1.4767528}}&amp;lt;/ref&amp;gt;, the density predicted by ideal gas law can be calculated as below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho^*=\frac{\sigma^3N}{V}=\frac{\sigma^3P}{k_BT}=\frac{\sigma^3\frac{P^*\epsilon}{\sigma^3}}{T^*\epsilon}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Final myj.PNG|650px|center|thumb|Figure 9:density vs time for both of the pressures]]&lt;br /&gt;
&lt;br /&gt;
From the graph, it can be seen that the simulated density is lower than the ideal density and the discrepancy increases as pressure increases and it decreases as temperature increases.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You need to explain why you see these trends.  What is the difference between your simulations and an ideal gas and how does that result in the trends that you see?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating heat capacities using statistical physics==&lt;br /&gt;
&lt;br /&gt;
The heat capacity of the system can be calculated by the equation showing below:&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, the temperatures and densities used are 2.0,2.2,2.4,2.6,2.8 and 0.2, 0.8 respectively.&lt;br /&gt;
&lt;br /&gt;
One of the input scripts is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
variable dens equal 0.2&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${dens}&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 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;
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;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp vol atoms&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable atoms2 equal atoms*atoms&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_temp v_temp2 v_volume v_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[1]&lt;br /&gt;
variable heatcapacity equal ${atoms2}*(f_aves[5]-f_aves[4]*f_aves[4])/f_aves[2]&lt;br /&gt;
variable heatcapacityV equal ${heatcapacity}/${volume}&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;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity over V: ${heatcapacityV}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to make the heat capacity independent of the size, we plot &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; against temperature.&lt;br /&gt;
&lt;br /&gt;
[[file:HC myj.PNG|600px|thumb|center|figure 10: Cv/V against temperature for two different densities]]&lt;br /&gt;
&lt;br /&gt;
According to the equation, the temperature and heat capacity are inversely proportional. So the value of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; should decrease with temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The numerator in the heat capacity equation (&amp;lt;E&amp;gt; and &amp;lt;E^2&amp;gt;) also depends on temperature so you would have to consider this dependence as well.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As for a larger density system, it will have more atoms at a fixed volume and the ability of it to store internal energy will be stronger, therefore the value of &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; will be higher than at&amp;lt;math&amp;gt;\rho=0.2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
An atomic trajectory is recorded to generate RDFs for the solid, liquid, and vapour phase Lennard Jones systems. &lt;br /&gt;
In order to get 3 different phases, the density and temperature is modified as below &amp;lt;ref name=&amp;quot;PhysRev.184.151&amp;quot;&amp;gt;Jean-Pierre Hansen and Loup Verlet, &amp;quot;Phase Transitions of the Lennard-Jones System&amp;quot;, &#039;&#039;Phys. Rev.&#039;&#039;, &#039;&#039;&#039;184&#039;&#039;&#039;, 151, 1969.{{DOI|10.1103/PhysRev.184.151}}&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! vapour&lt;br /&gt;
! liquid&lt;br /&gt;
! solid&lt;br /&gt;
|-&lt;br /&gt;
| Temperature&lt;br /&gt;
| 1.15&lt;br /&gt;
| 1.2&lt;br /&gt;
| 1.15&lt;br /&gt;
|-&lt;br /&gt;
| Density&lt;br /&gt;
| 0.05&lt;br /&gt;
| 0.8&lt;br /&gt;
| 1.5&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:Capture gr myj.PNG‎|500px|thumb|center|Figure 11: RDFs for 3 systems]]&lt;br /&gt;
&lt;br /&gt;
The RDF[https://en.wikibooks.org/wiki/Molecular_Simulation/Radial_Distribution_Functions] defines the probability of finding a particle at a distance r from another particle. For all 3 systems, when r is small, the value of g(r) is zero as two particles can not occupy the same space due to repulsion forces and the first coordination sphere is found when &amp;lt;math&amp;gt;r=\sigma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Gases do not have a regular structure and only have one coordination sphere that will rapidly decay to normal density, g(r)=1.&lt;br /&gt;
&lt;br /&gt;
Solids have regular and specific structure over a long range. The peaks indicate the coordination shells for the solid. The first peak represents the nearest neighbours, the second peaks is for the second nearest neighbours and so on. There is no possibility to find particles in between as all molecules are regularly packed.&lt;br /&gt;
&lt;br /&gt;
Liquids are more loosely packed than solids, therefore, do not have exact intervals.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Atoms in a liquid are not on a lattice so no long range order, but they do have short range order.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gr of solid.PNG|400px|thumb|Figure 12:first 3 peaks in RDF of solid]]||[[File:Integral of solid.PNG|400px|thumb|Figure 13: running integral of RDF of solid]]&lt;br /&gt;
|}&lt;br /&gt;
Acoording to the plot above, as for solid, the coordination number of the first coordination shell is 12. And the coordination number for the second and third shell is 6 and 24 respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Are these coordination numbers what you would expect?  Can you identify the atoms responsible for the first, second and third peaks on an fcc structure?  A diagram here would be good.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
The densities and temperatures used are the same as last section.&lt;br /&gt;
The graphs below show the simulation of MSD of liquid, solid and gas as well as for a 1 million atoms system.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Vapour small myj.PNG|400px|thumb|Figure 14a: Simulation for gas]]||[[File:Liquid myj.PNG|400px|thumb|Figure 14b: simulation for liquid]]&lt;br /&gt;
||[[File:Solid small myj.PNG|400px|thumb|Figure 14c:simulation for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Vapour large myj.PNG|400px|thumb|Figure 15a: Simulation for gas (much larger system)]]||[[File:Liquid msd myj.PNG|400px|thumb|Figure 15b: simulation for liquid (much larger system)]]&lt;br /&gt;
||[[File:Solid large myj.PNG|400px|thumb|Figure 15c: Simulation for solid (much larger system)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graphs vapour and liquid for both small and large scales are nearly the same.&lt;br /&gt;
The graph for solid at a small scale looks similar to the larger system one but with more fluctuations because the stability of a system containing 1 million atoms would be much higher.&lt;br /&gt;
&lt;br /&gt;
Solid shows a completely different shape due to its regular structure and it has a fixed position for each atom (with vibrations).&lt;br /&gt;
&lt;br /&gt;
The value of D can be estimated by the equation showing below:&lt;br /&gt;
&amp;lt;center&amp;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;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this case, &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;=gradient of trend line /timestep.&lt;br /&gt;
&lt;br /&gt;
As for small systems,&lt;br /&gt;
&lt;br /&gt;
vapour: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.0289}{0.002}=2.408&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{6\times10^{-9}}{0.002}=5\times10^{-7}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for larger systems,&lt;br /&gt;
&lt;br /&gt;
vapour: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.0305}{0.002}=2.542&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{6}\times\frac{5\times10^{-8}}{0.002}=4.17\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: This equation for the diffusion coefficient is only valid when the MSD graph is linear, so you should only fit the linear part of the graph to a straight line and calculate the gradient, don&#039;t use the whole data.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equation for the evolution of the position of a 1D harmonic oscillator as a function of time is shown below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;v(t)=\frac{dx(t)}{dt}&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t)=\frac {d[Acos(\omega t+\phi)]}{dt}=-\omega A sin(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-\omega A sin[\omega(t+ \tau)+\phi=-\omega A sin[\omega(t+\phi)+\omega \tau]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Acoording to the trigonometric formula &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-\omega A[sin(\omega t+\phi) cos(\omega \tau)+cos(\omega t +\phi) sin(\omega \tau)]=cos(\omega \tau)\times v(t)-\omega t[cos(\omega t+\phi) sin(\omega \tau)]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since &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;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}v(t)[v(t) cos(\omega \tau)-\omega t[cos(\omega t+\phi)sin(\omega \tau)]]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) =\frac{cos(\omega t)\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}-\frac{\int_{-\infty}^{\infty} -\omega t[cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = cos(\omega t) -\frac{\int_{-\infty}^{\infty} -\omega t[cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sine function is an odd function, which means the integral of it from &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt; will be zero. Therefore the second part of the equation shown above should also be zero.&lt;br /&gt;
&lt;br /&gt;
Then the equation can be simplified to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) =cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You have the right method, but there is a mistake in your working.  The final integral should be cos(omega*t+phi)*sin(omega*t+phi) which is an odd function and so the integral is zero.  In your working, you have the integral of cos(omega*t+phi) which is an even function.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The graph below shows the difference between VACFs of Lennard Jones liquid and solid and harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:Capacity myj.PNG|600px|thumb|center|Figure 16: VACFs for liquid, solid and &amp;lt;math&amp;gt;\omega=\frac{1}{2\pi}&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
The velocity of a molecule after the collision will be independent of its initial velocity&amp;lt;ref name=&amp;quot;1.434461&amp;quot;&amp;gt;Otto J. Eder, &amp;quot;The velocity autocorrelation function and the diffusion coefficient for a dilute hard&lt;br /&gt;
sphere gas&amp;quot;, &#039;&#039;J. Chem. Phys.&#039;&#039;, &#039;&#039;&#039;66&#039;&#039;&#039;, 3866 (1977).{{DOI|10.1063/1.434461}}&amp;lt;/ref&amp;gt;. Both magnitude and direction are expected to change with the influence of the force. The minimum value on the graph corresponds to the largest difference between final velocity and initial velocity. Solid has a lower value than the liquid due to stronger interatomic force. In the case of harmonic oscillator, the interatomic force is not involved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: There are no collisions in the harmonic oscillator which is why it doesn&#039;t decay.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following equation can be used to calculate D:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trapezium rule is then used to estimate the integrals under VACFs for gas, liquid and solid and the plots of running integral are shown below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gas s ri.PNG|400px|thumb|Figure 17a: running integral for gas]]||[[File:Liquid s ri.PNG|400px|thumb|Figure 17b: running integral for liquid]]&lt;br /&gt;
||[[File:Solid s ri.PNG|400px|thumb|Figure 17c: running integral for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As for larger systems:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&lt;br /&gt;
|[[File:Gas l ri.PNG|400px|thumb|Figure 18a: running integral for gas]]||[[File:Liquid l ri.PNG|400px|thumb|Figure 18b: running integral for liquid]]&lt;br /&gt;
||[[File:Solid l ri.PNG|400px|thumb|Figure 18c: running integral for solid]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Calculations for values of D for small systems:&lt;br /&gt;
&lt;br /&gt;
gas: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 9.27325499=3.091&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.293666634=0.098&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.002980073=9.933\times10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As for larger systems:&lt;br /&gt;
&lt;br /&gt;
gas: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 9.805397393=3.268&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
liquid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.270274429=0.090&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
solid: &amp;lt;math&amp;gt;D=\frac{1}{3}\times 0.000136588=4.553\times10^{-5}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The values of D obtained are very close to the values from the last section except for the value of solid.&lt;br /&gt;
&lt;br /&gt;
The trapezium rule is not that accurate especially for solid and it can be improved by smaller timestep.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Thermomp4114&amp;diff=584016</id>
		<title>Talk:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Thermomp4114&amp;diff=584016"/>
		<updated>2017-02-15T05:27:17Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: A few mistakes and parts of tasks missing, especially for the RDF and VACF sections.  Read through your report before submitting to correct typos and make sure that explanations are clear and make sense and check that your results are what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you think the error oscillates?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The potential energy doesn&#039;t contain mass either: 0.5*K*x^2.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &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\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, the well depth is -epsilon.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You&#039;re asked to calculate the volume of 10000 molecules, but your value is correct for 1000 molecules.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be 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;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, give distance in nm rather than 10^-7 cm.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&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; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Using variables makes it easy to use the same script to run many simulations under different conditions, without having to change every command manually.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and reasoning.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&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;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &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; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the lack of interactions in an ideal gas means that particles are much closer together.  How does the difference between the ideal gas and simulation data change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&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;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot Cv\V Vrs T generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: At higher density there are more particles per unit volume and so more energy is required per unit volume to raise the temperature by the same amount, so the heat capacity is higher.  Your simulations contain spherical particles so there are no rotational, vibrational or electronic energy levels.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What about the solid RDF?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: A diagram would help to explain the positions of these atoms.  How many atoms are represented by each peak, can you tell from the integral of the RDF?  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show these lines on the plots.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Collisions cause particle velocities to be randomised and the VACF to decay to zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation 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;
&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;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &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;
Cancelling -A\omega: &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^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \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;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, well spotted to simplify the integral into odd and even functions.  There is a factor of sin(omega*t+tau) missing in the line before the simplification.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How can the diffusion coefficient be negative?  Do the running integral graphs make sense if you look at the VACF graph?  The running integral should increase initially and then plateau as the VACF decays to zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Thermomp4114&amp;diff=584015</id>
		<title>Talk:Thermomp4114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Thermomp4114&amp;diff=584015"/>
		<updated>2017-02-15T05:24:27Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: A few mistakes and parts of tasks missing, especially for the RDF and VACF sections.  Read through your report before submitti...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: A few mistakes and parts of tasks missing, especially for the RDF and VACF sections.  Read through your report before submitting to correct typos and make sure that explanations are clear and make sense and check that your results are what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Molecular Dynamics Simulations of Simple Liquids Introduction == &lt;br /&gt;
&lt;br /&gt;
Molecular dynamic simulations involved studying the motion of a system of particles. Several fundamental elements of a system need to be known in order to achieve this. This includes a knowledge of the interaction potential for the particles and the equations of motion which govern the dynamics of the particles.&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Once we know the positions, velocities, and forces, of the atoms (which are obtained using statistical) we can calculate various thermodynamic quantities of the system such as temperature and pressure. We must introduce a series of approximations in order for the caluculations to be feasible. Firstly we apply the &#039;&#039;&#039;The Classical Particle Approximation&#039;&#039;&#039;. The schoedinger equation is too complex to solve for a large system of atoms, however if the atoms are treated classically then the positions and and velocities of each can atom can be calculated using Newton&#039;s second law (equation 1): &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F}_i = m_i \mathbf{a}_i = m_i \frac{\mathrm{d}\mathbf{v}_i}{\mathrm{d}t} = m_i \frac{\mathrm{d}^2 \mathbf{x}_i}{\mathrm{d}t^2} \ \ (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As there are N atoms and therefore N equations representing each atom a computer is a necessity. The &#039;&#039;&#039;Verlet algorithim&#039;&#039;&#039; is used to solve to Newton&#039;s law for all the atoms in the system. In this case time is not continuous but is made discrete, the simulation is thus broeken up into specific &#039;&#039;&#039;timesteps&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The position of atom &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; is given by &amp;lt;math&amp;gt;\mathbf{x}_i \left(t\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positional Verlet algorithim (equation (2)): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{x}_i\left(t + \delta t\right) \approx 2\mathbf{x}_i\left(t\right) - \mathbf{x}_i\left(t - \delta t\right) + \frac{\mathbf{F}_i\left(t\right)}{m_i}\delta t^2 \ \ (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Velocity Verlet algorithim (equation (3)):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{v}_i \left(t\right)&amp;lt;/math&amp;gt; represents the velocity of that atom at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{v}_i\left(t + \delta t\right) = \mathbf{v}_i\left(t + \frac{1}{2}\delta t\right) + \frac{1}{2}\mathbf{a}_i\left(t + \delta t\right)\delta t \ \ (3)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Put in example of industrial applications&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator ===&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator illustrates the the accuracy and discrepancies associated with using the velocity Verlet algorithim. Equation (4) is used to model the behavior of the harmonic oscillator in an analytical sense: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)\ \ (4)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; = 0.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; = 1.00 &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; = 1.00 &lt;br /&gt;
&lt;br /&gt;
Graph (1) illustrates the results the analytical solution gave for the relationship between position and time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Avrsxt2.png|x300px|thumb|Graph 1: Analytical solution of harmonic oscillator|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The difference in position between the velocity-verlet solution and analytical solution is represented by an error. Error plotted against time is illustrated by graph (2). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ErrorvrsT.png|x300px|thumb|Graph 2: Error vrs Time|centre]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The orange line illustrates the positive trend between error and time. This shows that error is accumulative with time. Each timestep represents a calculation which has an associated error thus as the simulation proceeds the errors will be summed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why do you think the error oscillates?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The total energy of the system will consist of the sum of kinetic and potential energy. Equation (5) can be used to find kinetic energy of the system:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;E_\text{k} =\tfrac{1}{2} mv(t)^2 \ \ (5)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;math&amp;gt;\mathbf{x} \left(t\right)&amp;lt;/math&amp;gt; is used in equation (5) the potential energy can be found. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The potential energy doesn&#039;t contain mass either: 0.5*K*x^2.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The following graphs represent the difference in change in energy with time when the timestep is varied. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EvrsTime.png|x200px|thumb|Energy change when a timestep of 0.1 is used|left]]&lt;br /&gt;
! [[File:Energy vrs time for 0.15 timestep.png|x200px|thumb|Energy change when a timestep of 0.15 is used|centre]]&lt;br /&gt;
! [[File:Energy vrs time for 0.2 timestep.png|x200px|thumb|Energy change when a timestep of 0.2 is used|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The maximum change in energy for each of the different timesteps is shown in table (1). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | Timestep&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.1&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.15&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | 0.2&lt;br /&gt;
|-&lt;br /&gt;
| Max. change in Energy&lt;br /&gt;
| 0.2%&lt;br /&gt;
| 0.6%&lt;br /&gt;
| 1%&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The results clearly indicate that a timestep greater than &#039;&#039;&#039;0.2&#039;&#039;&#039; will result in an energy change greater than 1%. As the timestep increases as does the maximum error. The timestep defines the number of calculations made in a given time, therefore the shorter the timestep the larger the number of calculations carried out and therefore a more accurate result is produced. The total energy of a real physical system should not change, when modeled numerically there can be fluctuations therefore it is important to monitor this change and ensure that the fluctuations are minimised.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
The forces an atom experiences is determined by the positions of all the atoms in the system, &amp;lt;math&amp;gt;\mathbf{r}^N&amp;lt;/math&amp;gt;. The Lennard-Jones function accurately sums all the key inter-atomic forces an atoms experiences (U). &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\} \ \ (10)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;0 = 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After division by 4 and rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\sigma^{6}}{r_0^{6}} = \frac{\sigma^{6}}{r_0^{6}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After further rearrangement and cancelling down: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0 = \sigma &amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;-\sigma &amp;lt;/math&amp;gt; is also a solution however this can be disregarded. &lt;br /&gt;
&lt;br /&gt;
In order to calculate the force the following equation is used: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\sigma\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After differentiation and simplification: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathbf{F}(r_0) =  \frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
At equilibrium: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{12\sigma^{12}}{r_e^{13}} - \frac{6\sigma^6}{r_e^7} \right)&amp;lt;/math&amp;gt; = 0&lt;br /&gt;
&lt;br /&gt;
After rearrangement: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_e = 2^{1/6} \sigma &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This value of &amp;lt;math&amp;gt; r_e &amp;lt;/math&amp;gt; can now be used to find the well depth:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt; 4\epsilon\left(\frac{\sigma^{12}}{4sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon\left(\frac{1}{5r^{5}} - \frac{1}{11r^11} \right)^\infty_2 \simeq -2.48 \sdot 10^{-2} &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -8.18 \sdot 10^{-3} &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&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; \simeq -3.29 \sdot 10^{-3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct, the well depth is -epsilon.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
* No. of moles in  1 mL of water = 0.056 &amp;lt;br&amp;gt; &lt;br /&gt;
* No. of molecules = moles x Avogadro&#039;s constant = 3.37 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*1000 molecules = 1.66 x 10&amp;lt;sup&amp;gt;21&amp;lt;/sup&amp;gt; moles&lt;br /&gt;
* Density = mass/vol. = 1 &lt;br /&gt;
*vol. = mass/density = 2.99 x 10&amp;lt;sup&amp;gt;-20&amp;lt;/sup&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You&#039;re asked to calculate the volume of 10000 molecules, but your value is correct for 1000 molecules.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Due to periodic boundary condition once the atom leaves the current box it will enter the beginning of an identical box. The atom is at &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; and thus once it breaches 0.5 in a particular direction it will be at the start of the next box. Using these principles after the atom moves &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will be 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;
=== Reduced Units === &lt;br /&gt;
&lt;br /&gt;
Reduced units are applied to the Lennard-Jones equation to make the calculation more managable.&lt;br /&gt;
&lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For argon:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Distance in real units: r = 1.09 x 10&amp;lt;sup&amp;gt;-7&amp;lt;/sup&amp;gt; cm&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Well depth = &amp;lt;math&amp;gt;{\epsilon}&amp;lt;/math&amp;gt; = 0.996 KJmol&amp;lt;sup&amp;gt;-1&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* T = 180 K&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, give distance in nm rather than 10^-7 cm.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Equilibriation = &lt;br /&gt;
&lt;br /&gt;
=== Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
As there is a large number of atoms in a discrete volume allowing random assignment of positions could result in atoms overlapping. This would cause an unrealistically high potential as potential is distance dependant (as observed in the Lennard - Jones equation).&lt;br /&gt;
&lt;br /&gt;
* Density is given by the following equation: &lt;br /&gt;
&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; n &amp;lt;/math&amp;gt; = 1 (as there is only 1 atom per unit cell) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = 1.07722^3 = 1.25 &amp;lt;/math&amp;gt; (lattice spacing = 1.07722) &lt;br /&gt;
&lt;br /&gt;
Thus: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac{1}{1.25} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The length of a side of one fcc unit cell with number density 1.2 would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v = \frac{n}{\rho} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n &amp;lt;/math&amp;gt; = 4 (as there is 4 atoms per unit cell in an fcc lattice) &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v &amp;lt;/math&amp;gt; = 3.33&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; l = v^{-3} = 1.49 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The number of atoms that would be created by the create_atoms command for an fcc lattice would be: &lt;br /&gt;
&lt;br /&gt;
4 x 1000 = 4000 &lt;br /&gt;
&lt;br /&gt;
This is due to fact that there is 1 atom per unit cell that yeilds 1000 altogether in simple cubic. Fcc has 4 times the number of atoms per unit cell. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of Atoms === &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command above has the following purpose: &lt;br /&gt;
&lt;br /&gt;
* The first line sets the mass of all atoms of type &#039;1&#039; to 1.0. &lt;br /&gt;
*  Line 2 is used to control the Lennard-Jones potential. The value of 3.0 indicates the distance in reduced units upon which the potential is calculated. The potential is distance dependent and falls to 0 at large values of r thus only atoms within a distance of 3.0 are considered.  &#039;lj/cut&#039; defines the cut off point. &lt;br /&gt;
* The last line defines the force field constants as 1.0 for all sets of atoms. The * controls the fact that the command is set for all atoms. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet is the integration algorithm that can be used when &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt; are defined. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The codes is in place to ensure that the timestep can be varied but the total time taken for the simulation to run will not change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Using variables makes it easy to use the same script to run many simulations under different conditions, without having to change every command manually.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Checking equilibration === &lt;br /&gt;
&lt;br /&gt;
The graphs below illustrate the time it takes for different thermodynamic properties to equilibriate at a timestep of 0.001. The plateau represents the point at which equilibration is achieved. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:EnergyVRStime.png|x300px|thumb|Energy Vrs Time|left]]&lt;br /&gt;
! [[File:TEMPvrsTIME.png|x300px|thumb|Temp vrs Time|centre]]&lt;br /&gt;
! [[File:Press Vrs Time.png|x300px|thumb|Pressure Vrs Time|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The graph below illustrates the effect changing the timestep has on equilibration. As can be seen from the graph a from below 0.01 a shorter timestep results in a lower energy value for equilibration until 0.0025 where the value   of equilibration does not change with lower timestep. This trend is due to the fact that a smaller timestep results in a more accurate result however if it is too small this can over-complicate the calculation (especially when there is a large over-all time). Thus a timestep of 0.0025 is a good balance and therefore ideal. A timestep of 0.025 is too large and results in the system not reaching equilibrium.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnergyVtimeFORVTS.png|x400px|thumb|Energy Vrs Time with different timesteps|centre]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep and reasoning.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Running Simulations Under Specific Conditions =&lt;br /&gt;
&lt;br /&gt;
The following two equations can be used to define the energy of the system: &lt;br /&gt;
&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;
The instantaneous tempertaure &amp;lt;math&amp;gt;T&amp;lt;/math&amp;gt; will not remain constant throughout the simulation and will fluctuate, it will thus be different to out target temperature &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The value of &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; is as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}\frac{3}{2} N k_B T = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2}T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma^{2} = \frac{\mathfrak{T}}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = (\frac{\mathfrak{T}}{T})^{1/2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the preceding code: &lt;br /&gt;
&lt;br /&gt;
100 - Nevery: This command results in a sample being taken every 100 steps and being incorporated into the average. 1000 - Nrepreat: Tells the computer how many samples should be used to calculate the average. Nfreq 10 000: At every 10000th timestep an average is calculated. &lt;br /&gt;
&lt;br /&gt;
All thermodynamic properties are calculated by averages that is the necessity for those commands.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equation of State ===&lt;br /&gt;
&lt;br /&gt;
[[File:DENSITYvrsT.png|x400px|thumb|Density Vrs Temp|centre]]&lt;br /&gt;
&lt;br /&gt;
The densities produced from the simulation are lower than for the ideal gas. This is a result of the simulation creating a more realistic picture of how the atoms interact as it takes into account Lennard-Jones potential. In an ideal gas the motion of atoms will be random, chaotic and inter atomic interactions are ignored however in the simulation the atoms will want to minimize their potential and therefore this will drive them to occupy a greater volume thus reducing the density.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, the lack of interactions in an ideal gas means that particles are much closer together.  How does the difference between the ideal gas and simulation data change with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Calculating Heat Capacities Using Statistic Physics =&lt;br /&gt;
&lt;br /&gt;
Example of input code used: &lt;br /&gt;
&lt;br /&gt;
* Density 0.2&lt;br /&gt;
* Temperature 2.0 &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP &amp;lt;br&amp;gt;&lt;br /&gt;
 RUN SIMULATION TO MELT CRYSTAL &amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
unfix nve&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BRING SYSTEM TO REQUIRED STATE&amp;lt;br&amp;gt; &lt;br /&gt;
variable tdamp equal ${timestep}*100&amp;lt;br&amp;gt;&lt;br /&gt;
variable ddamp equal ${timestep}*1000&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
run 10000&amp;lt;br&amp;gt;&lt;br /&gt;
reset_timestep 0&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MEASURE SYSTEM STATE &amp;lt;br&amp;gt;&lt;br /&gt;
unfix nvt&amp;lt;br&amp;gt;&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&amp;lt;br&amp;gt;&lt;br /&gt;
thermo_style custom step etotal temp press density&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot equal etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable etot2 equal etotal*etotal&amp;lt;br&amp;gt;&lt;br /&gt;
variable temp equal temp&amp;lt;br&amp;gt;&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_etot v_temp v_etot2&amp;lt;br&amp;gt;&lt;br /&gt;
run 100000&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
variable aveetot equal f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
variable avetemp equal f_aves[2]&amp;lt;br&amp;gt;&lt;br /&gt;
variable aveetot2 equal f_aves[3]&amp;lt;br&amp;gt;&lt;br /&gt;
variable varetot equal f_aves[3]-f_aves[1]*f_aves[1]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
print &amp;quot;Energy Variance: ${varetot}&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following equation was then used to calculate heat capacity from the results:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C_V = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[File:Heat capacity with T.png|x400px|thumb|Heat Capacity Vrs Temp|centre]]&lt;br /&gt;
&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;
For a fixed number of particles, &amp;lt;math&amp;gt; N &amp;lt;/math&amp;gt;, a larger density is indicative of a smaller volume. That is why the plot Cv\V Vrs T generally lies at a higher values for a density of 0.8. &lt;br /&gt;
&lt;br /&gt;
From both plots it can been seen that heat capacity increases with temperature.  &amp;lt;math&amp;gt; Var[E] &amp;lt;/math&amp;gt; increases with temp as at higher temp there are a greater number of accessible rotational, vibration, electronic and kinetic energetic states therefore the system is able to to absorb more energy per rise in temperature.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: At higher density there are more particles per unit volume and so more energy is required per unit volume to raise the temperature by the same amount, so the heat capacity is higher.  Your simulations contain spherical particles so there are no rotational, vibrational or electronic energy levels.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Structural Properties and the Radial Distribution function =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:G(r).png|x300px|thumb|RDF at different phases|left]]&lt;br /&gt;
! [[File:Integral.png|x300px|thumb|Integral of g(r)|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To carry out the RDF calculations temperature was kept constant at 1.2 but density was varied. &lt;br /&gt;
&lt;br /&gt;
Density in reduced units used for each phase: &lt;br /&gt;
&lt;br /&gt;
* Gas = 0.05&lt;br /&gt;
* Liquid = 0.8 &lt;br /&gt;
* Solid = 1.2&lt;br /&gt;
&lt;br /&gt;
The number of peaks for each RDF plot decreases in the order gas&amp;lt;liquid&amp;lt;solid. This reflects the ordering of each phase. &lt;br /&gt;
A gas has a large degree of disorder and thus produces only peak.&lt;br /&gt;
The liquid has three peaks which gradually decrease in amplitude, this behavior is due to the fact that the liquid is modeled as central molecule surrounded by shells of other molecules, this initially creates some degree of order. As the simulation continues the molecules become more diffuse so the ordering decreases and thus the amplitude of peaks decrease.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What about the solid RDF?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Solid nearest coordination.png|x400px|centre]]&lt;br /&gt;
&lt;br /&gt;
The above plot indicates the positions of the first three peaks. These will correspond to the three closet atoms in the lattice. &lt;br /&gt;
&lt;br /&gt;
* 1.025 will correspond to one of the atoms at the corner of the unit cell neighboring the starting position.&lt;br /&gt;
* 1.525 will correspond to one of the atoms in the centre of the face of the cube. (The lattice is fcc) &lt;br /&gt;
* 1.825 will correspond to an atom on one of the faces adjacent to the starting point. It cannot be one of the adjacent corners as this would be too large thus it must fall in between the corners and therefore on a face.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: A diagram would help to explain the positions of these atoms.  How many atoms are represented by each peak, can you tell from the integral of the RDF?  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Dynamical Properties and the diffusion coefficient = &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid.png|thumb|solid|x300px|left]]&lt;br /&gt;
! [[File:Liquid.png|thumb|liquid|x300px|centre]]&lt;br /&gt;
! [[File:Gas.png|thumb|gas|x300px|right]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The plot give insight into the displacement of particles as they illustrate &#039;&#039;&#039;mean square displacement&#039;&#039;&#039; with time. There are variations in the shape of the lines for the large number of atoms and small number of atoms, this is due to the variations in positions being averaged for a large number of atoms and thus gives a better indication of the behavior of the system. The difference is very apparent for solid where one can see that the line is much more smooth in the region where the gradient becomes close to 0. &lt;br /&gt;
&lt;br /&gt;
The diffusion constant D was found by calculating the gradient of the line for each phase. The gradient after the line had leveled off was used for the solid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show these lines on the plots.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 0.0304&lt;br /&gt;
| 0.0305&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| 0.001&lt;br /&gt;
| 0.0012 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| &amp;lt;math&amp;gt; 6 x 10^{-8} &amp;lt;/math&amp;gt;&lt;br /&gt;
| &amp;lt;math&amp;gt; 7 x 10^{-9} &amp;lt;/math&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a gradual decrease in D in the order solid&amp;lt;liquid&amp;lt;gas. This fits out chemical intuition; e.g. the motion of a solid would be much more restricted that the motion of a gas.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACFvrsTS.png|x400px|thumb|VACF vrs Temperature|centre]]&lt;br /&gt;
&lt;br /&gt;
Minima in the VACF plot correspond to points where the atoms collide and change direction. The greater number of minima for a solid is due to the restricted mean square displacement in which the atoms can move, this therefore results in greater collisions as the atoms seek to minimize their potential energy. As a liquid has a greater diffusion coefficient it is able to diffuse away from an atom after a collision, this is why there are fewer minima, the line tends to 0 as the atoms eventually move in opposite directions resulting in velocities cancelling out and therefor the integration becomes 0. The harmonic oscillator is simply a mathematical function without physical meaning therefore it will continue to oscillate around 0 until infinity. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Collisions cause particle positions to be randomised and the VACF to decay to zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The normalised velocity autocorrelation function for a 1D harmonic oscillator can be evaluated using the equation 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;
&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;
Differentiation of the displacement function will produce a velocity function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx}{dt} = -A\omega\sin\left(\omega t + \phi\right) = v(t) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -A\omega\sin\left(\omega t + \omega\tau + \phi\right) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substitution into velocity autocorrelation: &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;
Cancelling -A\omega: &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^2\left(\omega t + \phi\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Trigometric relation can simplify equation: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin\left(\omega t + \omega\tau + \phi\right) = cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} cos(\omega\tau + \phi)sin(t\omega) + sin(\omega\tau + \phi)cos(t\omega) \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;
Integration of ansymmetical function results in 0:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \int_{-\infty}^{\infty} sin(x)cos(x)\mathrm{d}t = 0 &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Thus after &amp;lt;math&amp;gt;cos(t\omega) &amp;lt;/math&amp;gt;is removed from top line the equation simplifies to: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = cos(t\omega) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, well spotted to simplify the integral into odd and even functions.  There is a factor of sin(omega*t+tau) missing in the line before the simplification.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Vapourphse.png|thumb|Vapour Phase|x300px|left]]&lt;br /&gt;
! [[File:Vapour phase 1 million.png|thumb|Vapour Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Solid(small).png|thumb|Solid Phase|x300px|left]]&lt;br /&gt;
! [[File:Solid1million.png|thumb|Solid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! [[File:Liquidsmallno..png|thumb|Liquid Phase|x300px|left]]&lt;br /&gt;
! [[File:Liquid1millionatoms.png|thumb|Liquid Phase of 1 million atoms|x300px|centre]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | &lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (small System)&lt;br /&gt;
! style=&amp;quot;background: #0D4F8B; color: white;&amp;quot; | D (Large System)&lt;br /&gt;
|-&lt;br /&gt;
| Vapour Phase&lt;br /&gt;
| 1.64&lt;br /&gt;
| 1.63&lt;br /&gt;
|-&lt;br /&gt;
|Liquid Phase&lt;br /&gt;
| -0.2215&lt;br /&gt;
| 0.157 &lt;br /&gt;
|-&lt;br /&gt;
|Solid Phase&lt;br /&gt;
| 0.254&lt;br /&gt;
| -0.123&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the trapezium rule to calculate D from a VACF plot yeilded a similar trend in diffusion coefficients however there was a discrepancy in one of my results. The value of D for a liquid of small number of atoms was smaller and more negative than the solid. This indictaes that using the MSD method is more accurate than VACF. This also indicates that it is more important to use the VACF plot for a large system when calculating D.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How can the diffusion coefficient be negative?  Do the running integral graphs make sense if you look at the VACF graph?  The running integral should increase initially and then plateau as the VACF decays to zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= References = &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Mark Klarpus, Gregory A. Petsko, (1990) &#039;&#039;Molecular Reaction Dynamics in Biology&#039;&#039;, &#039;&#039;&#039;347&#039;&#039;&#039;, 631-9, doi:10.1038/347631a0&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Liq_Sim:Zm714&amp;diff=582841</id>
		<title>Talk:Liq Sim:Zm714</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Liq_Sim:Zm714&amp;diff=582841"/>
		<updated>2017-02-09T21:33:39Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted with a few mistakes.  Try to make your written explanations clearer and more focused to show that you unde...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted with a few mistakes.  Try to make your written explanations clearer and more focused to show that you understand what your results show and why.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=Liquid Simulations&amp;lt;ref name=&amp;quot;Wiki task page&amp;quot;&amp;gt;https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&amp;lt;/ref&amp;gt;=&lt;br /&gt;
==Introduction to Molecular Dynamics==&lt;br /&gt;
===The Classical Particle Approximation===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By referring to &#039;&#039;&#039;Fig.1&#039;&#039;&#039; (below), the analytical solution to the harmonic oscillator has been calculated using the formula using the formula &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; above using the data provided. As shown, the error was calculated by taking the absolute value of the results from the analytical and Velocity-Verlet solutions. Lastly, the total energy was also calculated by adding together the potential and kinetic energies of the harmonic oscillators. The kinetic energy of the oscillator can be given by &amp;lt;math&amp;gt; E_k = {1\over 2} mv^2&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;E_k&amp;lt;/math&amp;gt; is the total kinetic energy of the system, &amp;lt;math&amp;gt;m &amp;lt;/math&amp;gt;is the mass of the oscillator and is treated as constant throughout the simulation. &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; is the velocity at which the particle is vibrating at that moment in time. The potential energy of the system may be given by integrating Hooke&#039;s Law (allowed since the system is being treated classically), &amp;lt;math&amp;gt;F=-kL&amp;lt;/math&amp;gt;from &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; with respect to &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, yielding &amp;lt;math&amp;gt;V = {1\over2}kL^2&amp;lt;/math&amp;gt;; where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the potential energy, &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; is the force constant and &amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt; is the displacement of the atoms from their equilibrium positions. Hence the total energy of the system may be given as:&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_{TOTAL} = E_k + V = {1\over 2} mv^2 + {1\over2}kL^2&amp;lt;/math&amp;gt; (1)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Formulas_zm714.PNG|500px|thumb|centre|&#039;&#039;&#039;Fig. 1&#039;&#039;&#039; The formulas on the spreadsheet can be used to calculate the analytical value, the error and the total energy of the system]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The positions of the maxima can be found by looking at the Error-Time graph, and then extracting a the highest value from near this time period. These plots can then form a linear fit across the maxima curve (&#039;&#039;&#039;Table 1&#039;&#039;&#039; and &#039;&#039;&#039;Fig. 2&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
[[File:Absolute_error_graph.png|400px|thumb|center|&#039;&#039;&#039;Fig.2&#039;&#039;&#039; The absolute error against time.]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ Table 1&lt;br /&gt;
|-&lt;br /&gt;
! Time&lt;br /&gt;
! Error&lt;br /&gt;
|-&lt;br /&gt;
| 0.00&lt;br /&gt;
| 0.000000&lt;br /&gt;
|-&lt;br /&gt;
| 2.00&lt;br /&gt;
| 0.000758&lt;br /&gt;
|-&lt;br /&gt;
| 4.90&lt;br /&gt;
| 0.002008&lt;br /&gt;
|-&lt;br /&gt;
| 8.00&lt;br /&gt;
| 0.003301&lt;br /&gt;
|-&lt;br /&gt;
| 11.10&lt;br /&gt;
| 0.004604&lt;br /&gt;
|-&lt;br /&gt;
| 14.20&lt;br /&gt;
| 0.005911&lt;br /&gt;
|}&lt;br /&gt;
The graph clearly shows that there is a linear increase in the error with time by a factor of 0.004. This shows that as time increases, the error increases as there is a greater difference between the displacement in the analytical and approximate solutions. Consequently, the analytical and velocity-Verlet algorithm only deliver results with low errors when time is close to 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
At &amp;lt;math&amp;gt;t=0&amp;lt;/math&amp;gt;, the total energy of the system is 0.500 (this is a maximum). A 1% deviation from this value would mean that there tolerance of 0.005; i.e. the energy may lie anywhere between 0.495 and 0.500 to satisfy the query. At large timesteps (e.g 0.500, there is a deviation greater than 1%, however as we decrease this incrementally by 0.1, a timestep of 0.200 delivers the energies within a tolerance of 1%. &lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total energy of the system is to ensure that the the 1st law of thermodynamics is obeyed (i.e. the total energy of the system is the same before and after applying work). When using numerical techniques, several approximations are applied and so this law may sometimes be broken. It is therefore critical to monitor the total energy to prevent this from occurring.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: God choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;
&amp;lt;center&amp;gt;&#039;&#039;&#039;1)&#039;&#039;&#039; When the potential energy is zero, &amp;lt;math&amp;gt;\phi(r)=0&amp;lt;/math&amp;gt;; it follows that: &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;0 = 4\epsilon\bigg [{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{6}}\bigg]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;By diving through by &amp;lt;math&amp;gt;4\epsilon&amp;lt;/math&amp;gt; and then rearranging, it can be seen that:&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}={\sigma^{6} \over r_o^{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;By cancellation and rearranging, the following result is obtained when the potential is zero:&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{\sigma=r_o}&amp;lt;/math&amp;gt;(2)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;2)&#039;&#039;&#039; In order to find the force when &#039;&#039;&#039;Eqn. 2&#039;&#039;&#039; above holds true, the Lennard-Jones Potential, &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt;, is differentiated with respect to &amp;lt;math&amp;gt;r&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;F = {d\phi(r)\over dr}=4\epsilon\bigg [{6\sigma^{6} \over r^{7}}-{12\sigma^{12} \over r^{13}}\bigg]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Now insert the result from &#039;&#039;&#039;Eqn. 2&#039;&#039;&#039; into the above and cancel down:&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F= 4\epsilon\bigg [{-6 \over \sigma}\bigg] \Rightarrow F={-24\epsilon \over \sigma}&amp;lt;/math&amp;gt;(3)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;3)&#039;&#039;&#039; To find the equilibrium separation,&amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; must be differentiated with respect to &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; but recall that at equilibrium separation, the force is equal to 0: &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F = {d\phi(r)\over dr}=4\epsilon\bigg [{6\sigma^{6} \over r^{7}}-{12\sigma^{12} \over r^{13}}\bigg]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;But after dividing by &amp;lt;math&amp;gt;4\epsilon&amp;lt;/math&amp;gt; and rearranging, it can clearly be seen that:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{12\sigma^{12} \over r^{13}}={6\sigma^{6} \over r^{7}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;which after rearranging yields the result&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq}=2^{1\over 6}\sigma&amp;lt;/math&amp;gt;(4)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;4)&#039;&#039;&#039; The first integral may be evaluated as follows:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;4\epsilon\int\limits_{2\sigma}^{\infty}\bigg [{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{6}}\bigg] dr = {4\epsilon\sigma^{12}\bigg [{r^{-11} \over -11}\bigg]_{2\sigma}^\infty}-{4\epsilon\sigma^{6}\bigg [{r^{-5} \over -5}\bigg]_{2\sigma}^\infty}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;After substitution of &amp;lt;math&amp;gt;\epsilon=\sigma=1.0&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\infty=a&amp;lt;/math&amp;gt;, it follows after calculation that:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{1\over 5632}-{1\over 40} + \lim_{a \to \infty}\bigg [{4 \over {5a^{5}}} - {4 \over {11a^{11}}}\bigg]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;As &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; tends to infinity, the fractions within the limit tend to 0. As a result:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int\limits_{2\sigma}^{\infty}\phi(r)dr=-2.48\times10^{-2} (3 sf)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;By the same method, the other two integrals may be evaluated as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\int\limits_{2.5\sigma}^{\infty}\phi(r)dr=-8.18\times10^{-3} (3 sf)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int\limits_{3\sigma}^{\infty}\phi(r)dr=-3.29\times10^{-3} (3 sf)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;From the results, as the value of the lower integral limit increases, the area enclosed by the Lennard Jones curve decreases. This makes sense, since as the distance between two atoms increases, the potential energy decreases.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and nicely laid out, what about the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;)?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Periodic Boundary Conditions====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The concentration of pure water is 55.5 moldm&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;. The number of moles is equal to:&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{moles}=55.5 \times {1\over1000}&amp;lt;/math&amp;gt;. Which we then multiply by Avogadro&#039;s number to find &amp;lt;math&amp;gt;3.34 \times 10^{22}&amp;lt;/math&amp;gt; water molecules in 1mL of water.&lt;br /&gt;
To find the volume of 10,000 water molecules, the same principles can be applied as above to find that &amp;lt;math&amp;gt;2.99\times 10^{-19} \mathrm{mL}&amp;lt;/math&amp;gt; is the volume which they would occupy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To solve this problem, simply add the two vectors together:&lt;br /&gt;
&amp;lt;math&amp;gt;(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
However, the boundary of the box is &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt; so the molecule will appear on the other side of the box if any of the x,y or z components are greater than 1. Therefore it follows that the molecule&#039;s final position is &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Reduced Units====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
From the wiki task page, it is given that &amp;lt;math&amp;gt;r^*={r\over\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
Hence, by substitution of &amp;lt;math&amp;gt;\sigma = 0.34 \mathrm{nm}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r^*=3.2&amp;lt;/math&amp;gt;, the value of&amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; can be calculated to yield &amp;lt;math&amp;gt;1.09 \mathrm{nm} (3sf)&amp;lt;/math&amp;gt; as the answer.&lt;br /&gt;
&lt;br /&gt;
Substitution of the result above for the value of &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; into the Lennard Jones potential gives the following:&lt;br /&gt;
&amp;lt;math&amp;gt;\phi(r)=-3.25\times 10^{-14} J&amp;lt;/math&amp;gt;. However to find the well depth in &amp;lt;math&amp;gt;\mathrm{kJmol^{-1}}&amp;lt;/math&amp;gt;, the answer is divided by 1000 and multiplied by Avogadro&#039;s number.&lt;br /&gt;
The final answer is therefore &amp;lt;math&amp;gt;-1.97\times 10^{7} \mathrm{kJmol^{-1}} (3sf)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Again, by using the equation given; &amp;lt;math&amp;gt;T^*={k_bT\over\epsilon}&amp;lt;/math&amp;gt; and the data provided, the real temperature can be calculated as &amp;lt;math&amp;gt;0.0125 \mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Value of r is correct, but the well depth and temperature are not.  The well depth is just epsilon, so you just need to convert the value of epsilon that you&#039;re given, epsilon = 120K*kB, into kJmol-1.  The temperature is 1.5*120 = 180K.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Output of the first simulation===&lt;br /&gt;
====Creating the Simulation box====&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated close together, then they will both have a very high potential energy. The worst case scenario is if the system generates the atoms very close together - so much so that they are almost superposed. This this case, the Lennard-Jones potential energy would tend to infinity, which would cause problems when running the simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The high repulsion between atoms will cause the simulation to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centered cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;1)&#039;&#039;&#039;The number density can be given by:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho_N={N\over V}&amp;lt;/math&amp;gt;(5) &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;where &amp;lt;math&amp;gt;\rho_N&amp;lt;/math&amp;gt; is the number density of lattice points, &amp;lt;math&amp;gt;N &amp;lt;/math&amp;gt;is the number of lattice points and &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the cell.&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;The volume may be calculated as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;V=(1.07722)^3=1.25&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Hence it can be seen after substitution into &#039;&#039;&#039;Eqn. 5&#039;&#039;&#039;, that: &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;N={\rho_N}V=0.8\times 1.25&amp;lt;/math&amp;gt; &amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;hence &amp;lt;math&amp;gt;N=1&amp;lt;/math&amp;gt; QED.&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;2)&#039;&#039;&#039; A face centered cubic lattice has 4 lattice points per unit cell. Hence &amp;lt;math&amp;gt;N=4&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;By using a lattice density of 1.2, the volume is:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;V={N\over \rho_N}= {4\over 1.2}=3.33&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Since the unit cell is cubic, by taking the cube root of the volume, it can be seen that the side lengths,&amp;lt;math&amp;gt;L&amp;lt;/math&amp;gt;, are:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;L=\sqrt[3]{3.33}= 1.4938&amp;lt;/math&amp;gt;&amp;lt;/center&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;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By the same principles, 4000 atoms would be created with a cubic-F lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Setting the Properties of the atoms====&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1)&#039;&#039;&#039; mass 1 1.0 - allows us to set the mass for 1 atom type (hence 1) as 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2)&#039;&#039;&#039; pair_style lj/cut 3.0 - This takes into account the Lennard Jones potential of a pair of atoms whose cutoff distance is 3.0. Note that electrostatic forces (i.e. coulombic forces) are neglected from this calculation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3)&#039;&#039;&#039; pair_coeff * * 1.0 1.0 - This specifies a field co-efficient for the atoms. In this case, the field co-efficient is the same for both the atoms since they are both equal to 1.0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why is a cutoff used and what are the forcefield coefficients for the Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm will be used here.&lt;br /&gt;
&lt;br /&gt;
====Running the Simulation====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reason we are defining a variable from the lines in the first box. This means that as one simulation step is completed, it will loop through the command again retaining the information just calculated and run the simulation again. The lines in the second box would work, but we would need to keep re-typing the commands again as it would not be looped.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Not quite, the simulation doesn&#039;t loop through the whole script for each simulation step.  The advantage of using variables is that if we want to run a series of simulations with different timesteps we only have to specify the timestep once and all quantities which depend on the timestep, like the number of steps to run, can be changed automatically as in the example here.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Checking Equilibration====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Graph_P,T,E_for_0.001_overall_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 3&#039;&#039;&#039; Graph of P,T,E for a timestep of 0.001.]] [[File:Graph_P,T,E_for_0.001_close_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 4&#039;&#039;&#039; Close version of &#039;&#039;&#039;Fig. 3&#039;&#039;&#039; before the system reaches equilibrium.]]&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;Fig.3&#039;&#039;&#039; and &#039;&#039;&#039;Fig. 4&#039;&#039;&#039;, we can see that after the initial spikes in pressure, energy and temperature, the system quickly reaches equilibrium. The equilibrium mean temperature is approximately 1.2554 ± 0.0222, mean pressure is 2.6156 ± 0.1310 and average total energy is -3.1842 ± 0.0007. The ± numbers are standard deviations calculated from the data.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;Fig. 4&#039;&#039;&#039;, it is clear that the system reaches equilibrium very quickly, and is between 0.05 - 1 for temperature and pressure. The total energy reaches equilibrium more rapidly. This is because, as discussed earlier, the total energy of the system must be conserved.&lt;br /&gt;
&lt;br /&gt;
[[File:Graph_of_Energy_vs_Time_for_all_timesteps_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 5&#039;&#039;&#039; Graph of the total energy v time for all the timesteps trialed.]]&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;Fig. 5&#039;&#039;&#039;, it can be seen that the majority of the timesteps trialed reach an average total energy as is expected. 0.015 does, however, not. The most likely reason for this is because the timestep is too large and therefore covers too large a period of actual time. The fluctuations in this timestep are also very large.&lt;br /&gt;
The largest one which could be used to give acceptable results is a timestep of 0.01. This shows a flat total energy with lower fluctuations compared to 0.015. As the timestep decreases, the fluctuations about a mean value start to decrease too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Average total energy should not depend on the choice of timestep as it does for 0.01 and 0.0075.  0.0025 and 0.001 give the same average energy and so choosing the larger of these, 0.0025, might be a better choice.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
===Temperature and Pressure Control===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Temperatures of 1.8, 2.1, 2.4, 2.7 and 3 were chosen and pressures of 2.5 and 5 were used. A timestep of 0.001 was selected so that smaller fluctuations between the temperature and pressure variables would be obtained. This timestep should also allow a good compromise between the value obtained and the &#039;real time&#039; length of the simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Thermostates and Barostats====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;center&amp;gt;From above:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{1\over 2} \sum_{i}m_iv_i^2={3\over 2}Nk_bT&amp;lt;/math&amp;gt; (6)&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;But &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; is a co-efficient/ correction for the velocity so target temperature, &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, is reached. Hence &#039;&#039;&#039;Eqn. 6&#039;&#039;&#039; may be re-written as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{1\over 2} \sum_{i}m_i\gamma^2v_i^2={3\over 2}Nk_b\tau&amp;lt;/math&amp;gt;(7)&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Finally, by combining both &#039;&#039;&#039;Eqn. 6&#039;&#039;&#039; and &#039;&#039;&#039;Eqn. 7&#039;&#039;&#039; above:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma=\sqrt{\tau \over T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is also interesting to note that the equipartition function only takes into account kinetic energy and hence why there is no potential term here.&lt;br /&gt;
&lt;br /&gt;
====Examining the input script====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100: For every 100 timesteps, use an input value.&lt;br /&gt;
&lt;br /&gt;
1000: To calculate an average value, use an input value 1000 times.&lt;br /&gt;
&lt;br /&gt;
100,000: The simulation will calculate average every 100,000 timesteps.&lt;br /&gt;
&lt;br /&gt;
1000 input values contribute to the average.&lt;br /&gt;
&lt;br /&gt;
100,000 time units will be simulated as a result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting the Equations of State====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Plots of the density as a function of temperature were created for the simulations above:&lt;br /&gt;
&lt;br /&gt;
[[File:Origin_Graph_errorbars_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig.6&#039;&#039;&#039; Density against temperature for p =2.5 and p=5 with errorbars.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 6&#039;&#039;&#039; shows that for a given temperature, a higher pressure means that the system has a higher density. This is intuitive because at a given temperature, there is a constant amount of thermal energy within both systems. Therefore the only variable which can effect the density is the pressure applied to the system. Since the number of particles, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt;, in the system is constant, the effect due to the increased pressure will be on the volume. By recalling &amp;lt;math&amp;gt;\rho_N={N\over V}&amp;lt;/math&amp;gt;, as the volume,(&amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt;) decreases, the density increases. This trend can be followed across the temperature range, but is more pronounced for lower pressures compared to higher ones.&lt;br /&gt;
&lt;br /&gt;
In addition, as the temperature is increased, the density of the substance decreases given a constant pressure. The reason for this is because increasing temperature supplies the system with a larger amount of thermal energy. As a result, there is a greater number of collisions between the fixed number of atoms. This causes an increase in the volume of the system and hence a decrease in the density.&lt;br /&gt;
&lt;br /&gt;
[[File:Origin_Graph_withideal_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 7&#039;&#039;&#039; Density against temperature for p=2.5 and p=5 including comparisons to the ideal gas law.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 7&#039;&#039;&#039; (above) illustrates that when the system run is analysed with that of the ideal gas law. Some manipulation of the law is first required:&lt;br /&gt;
&amp;lt;center&amp;gt;It is well established that for an ideal system:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;PV=Nk_bT&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Rearranging yields:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho={N\over V}={P\over {k_bT}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Where &amp;lt;math&amp;gt;\rho&amp;lt;/math&amp;gt; is the density of the system. Note that since reduced terms are used, it can be explicitly stated that &amp;lt;math&amp;gt;k_b=1&amp;lt;/math&amp;gt;. Hence the final equation is obtained as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\rho={P\over T}&amp;lt;/math&amp;gt; (8)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The data shows that if the system was treated ideally, then the density of the system would have been larger. This is because of the assumptions we make when we are using an ideal approximation &amp;lt;ref&amp;gt;P. Atkins, J. de Paula; &#039;&#039;Atkins’ Physical Chemistry&#039;&#039;; Oxford University Press; Oxford; Ninth Edition; &#039;&#039;&#039;2009&#039;&#039;&#039;; pp 25-27.&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1) There are no interactions between any of the particles&lt;br /&gt;
&lt;br /&gt;
2) All the particles are &#039;points&#039; and do not occupy a volume&lt;br /&gt;
&lt;br /&gt;
3) The system may be treated classically&lt;br /&gt;
&lt;br /&gt;
4) The time it takes for a collision to occur is much larger than the collision time.&lt;br /&gt;
&lt;br /&gt;
If P=2.5 is compared to an ideal and simulated system, the density of the ideal system is larger than that of the simulated system. This is because in an ideal system, at a constant temperature, there is a constant amount of thermal energy applied to the systems. Since in the ideal approximation, we are assuming that there are no interactions, the atoms within the system are likely to pack more closely together and hence the density of the system will be higher. In addition, since &#039;points&#039; are used, it is significantly a smaller volume is occupied for a given pressure and hence the density will be higher.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, why do the simulation and ideal gas results get closer together at higher temperatures.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Heat Capacity Calculation===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extract 1&#039;&#039;&#039; below shows the example script for the heat capacity where &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T^* = 2.0 &amp;lt;/math&amp;gt; have been used. The script has been made by editing the &#039;&#039;npt.in&#039;&#039; script:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Extract 1&#039;&#039;&#039; - &#039;&#039;Note that this is has edited from the npt.in file provided to meet the needs of the task. &amp;lt;ref name=&amp;quot;Wiki task page&amp;quot;/&amp;gt;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable D equal 0.2&lt;br /&gt;
lattice sc ${D}&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 0.2&lt;br /&gt;
variable timestep equal 0.001&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;
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 N equal atoms&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E v_E2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable hc equal (${N}*${N})*((f_aves[8]-(f_aves[7]*f_aves[7]))/(f_aves[5]))&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${hc}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 8&#039;&#039;&#039; below illustrates the normalised heat capacity of the system with respect to temperature:&lt;br /&gt;
&lt;br /&gt;
[[File:Cv_vs_Temp_graph_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 8&#039;&#039;&#039; The normalised heat capacity against temperature. There is an anomalous result when T = 2.0 for ρ* = 0.2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 8&#039;&#039;&#039; shows the generalCorrect trend that as temperature increases, for a given density, the heat capacity of the system decreases. If the definition of specific heat capacity is firstly considered; it is the energy required to increase the energy of a system, with unit mass, by 1 K. Hence as T increase, a lower amount of thermal energy needs to be supplied to increase the temperature by 1 K. This is because at high T, there the number of collisions between particles increases and therefore will be able to transfer energy more rapidly and effectively. Consequently, the heat capacity of the system, at constant volume and density, will decrease.&lt;br /&gt;
&lt;br /&gt;
There is an anomalous result for &amp;lt;math&amp;gt;T = 2.0&amp;lt;/math&amp;gt;, when &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt;. The normalised heat capacity for this value is significantly higher than that of the the other results. It was expected that this value lie below the ρ* = 0.8 curve. Re-running of this specific simulation yielded the same result, so this is not a computational error. The reason for this point could be because when simulations are run computationally, approximations are made and this may have resulted in this point.&lt;br /&gt;
&lt;br /&gt;
Following the trend in &#039;&#039;&#039;Fig. 8&#039;&#039;&#039; for the points at a higher temperature, it is visible that given a constant temperature, the heat capacity of &amp;lt;math&amp;gt;\rho^* = 0.8&amp;lt;/math&amp;gt; is higher than that of &amp;lt;math&amp;gt;\rho^* = 0.2&amp;lt;/math&amp;gt;. Firstly, it is important to recall that the heat capacity on the y-axis of &#039;&#039;&#039;Fig. 8&#039;&#039;&#039; is &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; and therefore a volume normalised heat capacity. This means that comparisions between the two densities can be made appropriately. For &amp;lt;math&amp;gt;\rho^* = 0.2 &amp;lt;/math&amp;gt;, there would need to be a larger volume to occupy all the atoms (3375 of them) into a space of the required density. This means that the specific heat capacity of the system would decrease because the particles, although they are more free to move, transfer heat energy less effictively. By contrast, when &amp;lt;math&amp;gt;\rho^* = 0.8 &amp;lt;/math&amp;gt;, a smaller volume is required and the 3375 atoms are more closely packed together. This means that the nearest atom distance is lower and energy is transferred more effectively via collisions. Therefore a lower normalised heat capacity is observed for lower densities.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The trend with density is not about the frequency of collisions.  At higher densities there will be more particles in a given volume and hence more energy must be supplied per volume to raise the temperature by 1K.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
===Simulations in this section===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Values for the density and temperature for the system corresponding to a solid, liquid and vapour phase were chosen based on the work by Hansen and Verlet in Lennard-Jones phase diagrams. &amp;lt;ref&amp;gt;J. Hansen, L. Verlet; &#039;&#039;Phys. Rev.&#039;&#039;; &#039;&#039;&#039;1969&#039;&#039;&#039;; Vol. 184, Issue 1; pp 151-184. DOI: https://doi.org/10.1103/PhysRev.184.151&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table 2&#039;&#039;&#039; below shows the variables selected:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Table 2&#039;&#039;&#039; Variables used to calculate the radial distribution function&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Density&lt;br /&gt;
| 1.2 || 0.8 || 0.01&lt;br /&gt;
|-&lt;br /&gt;
! Temperature&lt;br /&gt;
| 1.0&lt;br /&gt;
| 1.0&lt;br /&gt;
| 1.0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:Plot_RDF_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 9&#039;&#039;&#039; radial distribution function against timestep for the three different phases.]]&lt;br /&gt;
&lt;br /&gt;
It is first important to firstly consider what &#039;&#039;&#039;Fig. 9&#039;&#039;&#039; represents; the peaks for each respective state are the nearest neighbour distance from the atom under consideration. It is, therefore, possible to determine the environment with respect to the atom under consideration and simulate what the system may look like.&lt;br /&gt;
&lt;br /&gt;
Comparing the Vapour and Liquid, it can be seen that there is one broad peak for the vapour before falling to zero; whereas with liquid, there is an initial sharp peak at the same distance, but then appears to be a form of sinusoidal exponential decay. The reason why vapour only has one peak at &amp;lt;math&amp;gt;g(r) = 2.47&amp;lt;/math&amp;gt; is because a gas has several more degrees of freedom compared to a liquid. This implies that there is more likely to be a lower degree of order within the system. This may help explain why the peak is broad in vapour as there there is no regular spacing thereafter unlike in the liquid, where the atom will still see some order around it. &lt;br /&gt;
&lt;br /&gt;
Comparing the Liquid and Solid radial distribution functions, the solid&#039;s function has sharper and less smooth peaks compared to the liquid, which can be explained by the fact that a liquid is more dynamic (it is easier to move atoms in a liquid than in a solid). Since there there are peaks occur approximately every 0.3-0.5 distance units, which shows that the solid has a very regular structure no matter how far the atom under consideration is. However, this is not the case with a liquid and is more interesting. There appears to be a regular degree of order to begin with which then disappears as we move further away from the atom under consideration. In liquids, this atom could form &#039;atom shells&#039; around it - so the first nearest neighbour peak is the first shell, second peak is the second shell and so forth. It makes sense that as distance between atoms is increased, their interactions decrease and consequently why &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; decreases as &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; increases for a liquid.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The liquid has short range order, but no long range order, unlike the solid.  The solid has peaks at large r indicating the lattice structure.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:FCC_Diagram_zm714.png|200px|thumb|center|&#039;&#039;&#039;Fig. 10&#039;&#039;&#039; FCC lattice showing the nearest sites.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 10&#039;&#039;&#039; above shows the three different environments around the black atom in the FCC lattice, and this gives rise to the first three initial peaks in the radial distribution function. The closest atom to the black atom is the blue (denoted (I)), and this will have the lowest &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; value. Then it is the red and finally in purple; with the purple being the cause of the third peak.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The purple atom is not responsible for the 3rd peak, if you draw the structure in 3D you should be able to spot an atom closer to the black atom than the purple one is.  Did you calculate the lattice spacing?  You could then have compared the distances to these atoms with the positions of the peaks in g(r).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PlotInt_RDF_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 11&#039;&#039;&#039; Density against timestep for the three different phases]]&lt;br /&gt;
&lt;br /&gt;
The integral of the radial distribution function is equal to the density of the system. It can be seen from &#039;&#039;&#039;Fig. 11&#039;&#039;&#039; that this is fairly constant for a gas compared to a solid and liquid.&lt;br /&gt;
&lt;br /&gt;
From the &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; plot, and the density plot, it is possible to calculate the co-ordination number of the system at each peak. The area under the first peak gives the value of the density at those &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; values. For example, the first peak lies between &amp;lt;math&amp;gt;0.8&amp;lt;r&amp;lt;1.2&amp;lt;/math&amp;gt;. By comparing this range to the graph in &#039;&#039;&#039;Fig. 11&#039;&#039;&#039;, it&#039;s possible to work out the density. This evaluates to approximately 12. This value also seems like a sound co-ordination number because in an FCC lattice, an atom will have 12 neighbors to it (referring to &#039;&#039;&#039;Fig. 10&#039;&#039;&#039; where there is only 1 unit cell, the atom has 3 nearest neighbours. Scale this up to 4 and there are 12). By repeating this process for the others, the density of the 2nd peak is 6 and 3rd is approximately 24.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Can you see that there are 6 and 24 atoms responsible for the other peaks from the structure?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Dynamical Properties and the Diffusion Co-efficient==&lt;br /&gt;
&lt;br /&gt;
===Mean Squared Displacement===&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; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The same conditions as in &#039;&#039;&#039;Table 2&#039;&#039;&#039; were used in this simulation.&lt;br /&gt;
&lt;br /&gt;
The plots from &#039;&#039;&#039;Fig. 12&#039;&#039;&#039; below show that the total mean squared displacement is much larger for a vapour than for a solid. This is expected since in a gaseous system, there is more room for movement. In a solid, each atom is &#039;fixed&#039; in its respective position and hence will only be able to move by very small amounts from that position before returning to it. For gases and liquids, there is a large increase possible because the atoms are not fixed and that of a gas is larger than of a liquid. A reason for this could be that the gas and liquid both follow Brownian motion: for the liquid, since the atoms are closer together, one atom will move a shorter distance compared to that of a gas where atoms are much further apart. &lt;br /&gt;
The values of D are: D[solid] = 0 (the value for D obtained for a solid is very, very small); D[liquid] = 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;; D[vapour] = 0.0121 area/unit time.&lt;br /&gt;
&lt;br /&gt;
[[File:R2vtimestep_zm714.PNG|400px|thumb|center|&#039;&#039;&#039;Fig. 12&#039;&#039;&#039; Mean Squared distance against timestep]]&lt;br /&gt;
&lt;br /&gt;
The value for diffusion co-efficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, for the solid is expected to remain 0. D[vapour] = 0.006 and D[liquid] = 1.66x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;. The calculation shows that the value for the diffusion co-efficient has increased. This is because with one million atoms, there is significantly larger sample taken and so will represent a more accurate value for the system.&lt;br /&gt;
&lt;br /&gt;
[[File:R2vtimestep_million_zm714.PNG|400px|thumb|center|&#039;&#039;&#039;Fig. 13&#039;&#039;&#039; Mean Squared distance against timestep for 1 million atoms]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Results look good.  Why do you think the mean squared displacement graph is not a straight line to begin with, especially for the gas?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&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 equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;The analytical solution for the position of a 1D harmonic oscillator is given by:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; hence by differentiation, the velocity is obtained:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x&#039;(t) = v(t) = -A\omega\sin\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;By considering the value at &amp;lt;math&amp;gt;v(t +\tau)&amp;lt;/math&amp;gt;, it can be seen that:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau) = -A\omega\sin\left(\omega (t+\tau) + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;So the integral becomes&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = {{(A\omega)^2\int_{-\infty}^{\infty}}\sin\left(\omega t + \phi\right)\sin\left(\omega(t +\tau) + \phi\right) dt \over {{(A\omega)^2\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right) dt}}}&amp;lt;/math&amp;gt;(9)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;If we first calculate the denominator of this integral:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{{(A\omega)^2\int_{-\infty}^{\infty}\sin^2\left(\omega t + \phi\right) dt}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;It is well established that:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin^2 (x) = {1\over 2} [1-\cos 2x]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Hence it follows that the integral becomes:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{{(A\omega)^2}\over 2}\int_{-\infty}^{\infty}1-\cos\left(2\omega t + 2\phi\right) dt&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;This integral may be evaluated as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\bigg [t-{1\over 2\omega}\sin (2\omega t + 2\phi)\bigg ]^\infty_{-\infty}&amp;lt;/math&amp;gt;(10)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;If the numerator is now calculated:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{(A\omega)^2} \int_{-\infty}^{\infty}\sin (\omega t + \phi)\sin (\omega(t+\tau ) + \phi) dt&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;It is possible to re-write the second sine function as:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin (\omega(t+\tau ) + \phi) = \sin (\omega t+ \phi + \omega\tau )&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;By using the trig. angle formula:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sin(G+B)= \sin(G)\cos(B) + \sin(B)\cos(G)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Given that &amp;lt;math&amp;gt;G=\omega t+ \phi&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B=\omega\tau&amp;lt;/math&amp;gt;, it can be seen that the integral transforms into:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{(A\omega)^2}\int_{-\infty}^{\infty}\sin (\omega t + \phi)[{\sin (\omega t + \phi)\cos(\omega \tau)} +{\sin(\omega \tau)\cos (\omega t + \phi)} ] dt&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Which once expanded yields:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{{(A\omega)^2}\cos(\omega\tau)\int_{-\infty}^{\infty}\sin^{2} (\omega t + \phi)} dt + {(A\omega)^2 \sin(\omega\tau)}\int_{-\infty}^{\infty}\sin(\omega t + \phi) \cos (\omega t + \phi) dt&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;It should be noted that the first integral on the left hand side was previously calculated as the denominator and also yields &#039;&#039;&#039;Eqn. 10&#039;&#039;&#039; above as the answer. &amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;To calculate the second integral:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{(A\omega)^2 \sin(\omega\tau)}\int_{-\infty}^{\infty}\sin(\omega t + \phi) \cos (\omega t + \phi) dt&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt; This integral can be calculated via inspection or substitution:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;u(t) = \sin (\omega t +\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\Rightarrow u&#039;(t) = \omega \cos (\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;After applying the substitution, the cosine terms will cancel, leaving (note the limits do not change here):&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;A^2\omega \sin(\omega\tau) \int_{-\infty}^{\infty} u du&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Which are evaluation and re-insertion of &amp;lt;math&amp;gt;u&amp;lt;/math&amp;gt;:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;{1\over 2}A^2\omega \sin (\omega\tau)[\sin^2 (\omega t + \phi)]^\infty_{-\infty}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;By substituting this back into &#039;&#039;&#039;Eqn. 9&#039;&#039;&#039;:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)={{(A\omega)^2\cos(\omega\tau)\bigg [t-{1\over 2\omega}\sin(2\omega t + 2\phi)\bigg ]^\infty_{-\infty} + {1\over 2}A^2\omega \sin (\omega \tau)\bigg [\sin^2 (\omega t + \phi)\bigg ]^\infty_{-\infty}} \over {{1 \over 2}(A\omega)^2 \bigg [t-{1\over 2\omega}\sin(2\omega t + 2\phi)\bigg ]^\infty_{-\infty}}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;After evaluating the limits, the solution converges and are left with:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = {{{{1\over 2}(A\omega)^2\cos(\omega\tau)t}} \over {{1\over 2}(A\omega)^2t}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;Which finally yields as the answer:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \cos(\omega \tau)&amp;lt;/math&amp;gt;(10)&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Derivation can be simplified so that no integration is needed.  Once you have used the trig angle formula, the sin squared integral cancels with the integral in the denominator and the sin*cos integral must be zero because it is an odd function integrated between limits symmetric about zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF_normal_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 14&#039;&#039;&#039; C(t) against timestep. Comparing the approximation to the vapour, liquid and solid systems.]]&lt;br /&gt;
&lt;br /&gt;
The minima from the VACFs (&#039;&#039;&#039;Fig. 14&#039;&#039;&#039; above) in the liquid and solid represent that there is a change in velocity, The minima represent that the atom&#039;s velocity is changing direction. There are greater number of minima in a solid compared to in a liquid. This is because in a solid FCC lattice, all atoms are fixed in their relative positions and so can only oscillate from this position. In a liquid, this is not true. It is interesting to note that for the solid, the VACF looks very much like an oscillator which has been damped; and hence why an atom is losing velocity over a period of time. This damping may be because when we start the simulation at t=0, the atom has the greatest energy, but then due to various interactions between it and other atoms within the lattice, it is pulled in various directions and hence why the oscillations appear damped.&amp;lt;ref&amp;gt;&#039;&#039;Democritus: The Velocity Autocorrelation Function.&#039;&#039;http://www.compsoc.man.ac.uk/~lucky/Democritus/Theory/vaf.html [Accessed 26/01/2017] &amp;lt;/ref&amp;gt; Here, the solid looks like it would work well with the approximation made because the VACFs are initially of similar magnitudes - so this would be a good approximation at low time periods. The vapour would be a poor choice since it follows no oscillatory velocity.  &lt;br /&gt;
&lt;br /&gt;
The VACF is different from the Lennard-Jones solid and liquid because in VACF, it is taken that each atom has an initial velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Which approximation are you talking about?  Why is the VACF for the harmonic oscillator different to the simulation?  The presence of random collisions in the simulation causes the VACF to decorrelate.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&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 integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fig. 15&#039;&#039;&#039; below shows the running trapezium-rule (&#039;&#039;&#039;Eqn. 11&#039;&#039;&#039;) integral and &#039;&#039;&#039;Table 3&#039;&#039;&#039; shows the total values from use of the trapezium-rule and the calculated D values from the given equation (&#039;&#039;&#039;Eqn. 12&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;Eqn. 11&#039;&#039;&#039; The Trapezium rule in its most basic form:&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(1st height) + 2(sum of other heights)_{n-1} + (last height)_n]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&#039;&#039;&#039;Eqn. 12&#039;&#039;&#039; The difussion co-efficient from the velocity autocorrelation function:&amp;lt;ref name=&amp;quot;Wiki task page&amp;quot;/&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACF_normal_trapeziumuleintegral_zm714.png|500px|thumb|center|&#039;&#039;&#039;Fig. 15&#039;&#039;&#039; The cumulative trapezium-rule integration of each phase]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Table 3&#039;&#039;&#039; Values from the trapezium rule and values for the diffusion co-efficient.&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Trapezium integrals&lt;br /&gt;
| 5.64x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 0.248 || 21.4&lt;br /&gt;
|-&lt;br /&gt;
! D/ area/unit time&lt;br /&gt;
| 1.88x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0826&lt;br /&gt;
| 7.12&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The integral values obtained are of the correct trend (ie vapour&amp;gt; liquid&amp;gt; solid). The reason for this trend is that it is expected that gaseous atoms can retain their velocities for longer without there being a significant decrease (there are few regular interactions). However, for a liquid and solid, there are nearby atoms which cause the velocity to change and therefore have much lower values for the integral. The diffusion co-efficients still follow the same trend as above as expected.&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms: &lt;br /&gt;
&lt;br /&gt;
[[File:VACF_millionatom_zm714.PNG|300px|thumb|center|&#039;&#039;&#039;Fig. 16&#039;&#039;&#039; For a million atoms]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF_millionatoms_trapeziumuleintegral_zm714.png|500px|thumb|center|&#039;&#039;&#039;Fig. 17&#039;&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|+ &#039;&#039;&#039;Table 4&#039;&#039;&#039; Values from the trapezium rule and values for the diffusion co-efficient for 1 million atoms.&lt;br /&gt;
! &lt;br /&gt;
! Solid&lt;br /&gt;
! Liquid&lt;br /&gt;
! Vapour&lt;br /&gt;
|-&lt;br /&gt;
! Trapezium integrals&lt;br /&gt;
| 1.37x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 0.270 || 9.81&lt;br /&gt;
|-&lt;br /&gt;
! D/ area/unit time&lt;br /&gt;
| 4.55x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt;&lt;br /&gt;
| 0.0901&lt;br /&gt;
| 3.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data for the 1 million atom simulation is lower for both the integral and the diffusion co-efficient. One of the major sources of error comes from the trapezium rule where the integral is not exact and therefore can be an over/ underestimate to the VACF. This can therefore lead to a large error in D.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Calculating the diffusion coefficient using the VACF depends on the integral of the VACF reaching a plateau.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:JMW114&amp;diff=580177</id>
		<title>Talk:Mod:JMW114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:JMW114&amp;diff=580177"/>
		<updated>2017-02-03T18:37:25Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes, especially in some of the early sections.  Make sure you properly understand the back...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes, especially in some of the early sections.  Make sure you properly understand the background theory to these tasks and check that your results make sense and are what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Third year simulation experiment : Molecular Dynamics Simulation =&lt;br /&gt;
&lt;br /&gt;
== Running your first simulation ==&lt;br /&gt;
* All of the simulations that are run in this experiment are performed on the Imperial College High Performance Compution systems (HPC).&lt;br /&gt;
* Five simulations were run each with a different timestep varying from 0.001 to 0.015&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time , &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: Analytical: &#039;&#039;&#039;Equation used is &amp;lt;math&amp;gt;x(t) = Acos(\omega t+\phi)&amp;lt;/math&amp;gt; which translates into the excel document as =$H$2*(COS(($H$3*B6)+$H$1)), with each of the letters representing each of the parts of the equation respectively&lt;br /&gt;
** &#039;&#039;&#039;Part 2: Error: &#039;&#039;&#039;Absolute value taken of the classical atom position subtracted from the velocity-Verlet solution atom position using the excel equation =ABS(F6-C6)&lt;br /&gt;
** &#039;&#039;&#039;Part 3: Energy: &#039;&#039;&#039;Total energy of the oscillator calculated by adding the kinetic energy and potential energy (&amp;lt;math&amp;gt;E=\frac{1}{2}mv^{2}+mgx&amp;lt;/math&amp;gt;) using the velocity-Verlet atom position solutions, this translated to the excel equation =(0.5*($B$3*(D6^2)))+($B$3*9.81*C6)&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;:[[File:Screen Shot 2016-12-06 at 18.33.28.png|400px|thumb|right|&#039;&#039;&#039;Figure 1&#039;&#039;&#039;: Diagram to show the function plotted to follow the error maxima.]]  For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
** Using the previous calculations a plot of error vs time was used to find out the region where the error maxima were. The data was then analysed to find the exact points where the maxima were seen and the time and error value recorded. These were then plotted on the same graph and a line of best fit plotted. The equation of the line of best fit was &amp;lt;math&amp;gt;y=0.0004x-7\textrm{x}10^{-5}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: &#039;&#039;&#039;The maximum timestep is 0.2. If the timestep is increased any further the energy oscillated by more than 1%.&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;It is important to monitor the total energy of a physical system when modelling its behaviour numerically as should no external forces be present in the simulation we would expect the total energy of the system to remain constant. The reason for doing numerical solutions is usually due to an analytical solution not being possible.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;.&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: &#039;&#039;&#039;The &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; equation was used to calculate the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy was zero. This was done by equating &amp;lt;math&amp;gt;\phi\left(r\right)=0&amp;lt;/math&amp;gt; and using the fact that &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, this gave the equation &amp;lt;math&amp;gt;\frac{r_{0}^{6}}{r_{0}^{12}}=4&amp;lt;/math&amp;gt; which in turn meant that &amp;lt;math&amp;gt;r_{0}=0.7937&amp;lt;/math&amp;gt;&#039;&#039;&#039;  &#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;The force at &amp;lt;math&amp;gt;r_{0}=0.7937&amp;lt;/math&amp;gt; was calculated by differentiating the equation &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, to get &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;. This gave &amp;lt;math&amp;gt;\textrm{F}_{i}=4\epsilon(\frac{12\sigma^{12}}{r_{0}^{13}}-\frac{6\sigma^{6}}{r^{7}})&amp;lt;/math&amp;gt;. The values of &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; were subbed in and the calculated distance from part 1, &amp;lt;math&amp;gt;r_{0}=0.7937&amp;lt;/math&amp;gt;, was also subbed in, when calculated this gave &amp;lt;math&amp;gt;\textrm{F}_{i}=846.67&amp;lt;/math&amp;gt;.&lt;br /&gt;
** &#039;&#039;&#039;Part 3: &#039;&#039;&#039;The equilibrium seperation was found using the fact that at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\textrm{F}_{i}=0&amp;lt;/math&amp;gt;, therefore using the same differential as in the previous step the equation to be solved is found to be &amp;lt;math&amp;gt;0=4\epsilon(\frac{12\sigma^{12}}{r_{eq}^{13}}-\frac{6\sigma^{6}}{r_{eq}^{7}})&amp;lt;/math&amp;gt;, this gave &amp;lt;math&amp;gt;r_{eq}=1.122462&amp;lt;/math&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;Part 4: &#039;&#039;&#039;The well depth was found using the initial equation &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; , subbing in the equilibrium distance found in the previous part, &amp;lt;math&amp;gt;r_{eq}=1.122462&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;, the answer was calculated to be &amp;lt;math&amp;gt;\phi\left(r_{eq}\right) = -1&amp;lt;/math&amp;gt;     &lt;br /&gt;
** &#039;&#039;&#039;Part 5: &#039;&#039;&#039;The integrals were evaluated by using the equations &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt; to form the equation &amp;lt;math&amp;gt;\int_{x\sigma}^{\infty}4\epsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^{6}}{r^{6}}).dr&amp;lt;/math&amp;gt;. The values of &amp;lt;math&amp;gt;\sigma=1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\epsilon=1&amp;lt;/math&amp;gt; were subsituted into the equation and it was integrated to give &amp;lt;math&amp;gt;4_{_{x}}^{^{\infty}}\left(\frac{0.2}{r^{5}}-\frac{1}{11r^{11}}\right)&amp;lt;/math&amp;gt;, when subbing in infinite, the first term always became zero and the second term varied depending on the value of x. When &amp;lt;math&amp;gt;x=2&amp;lt;/math&amp;gt; the integral output was 0.025, when &amp;lt;math&amp;gt;x=2.5&amp;lt;/math&amp;gt;  the integral output was 0.0082, and when &amp;lt;math&amp;gt;x=3&amp;lt;/math&amp;gt; the integral output was 0.0033.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Give analytical answers to the first questions rather than numerical values: r0 = sigma (=1), F=24*epsilon/sigma, well depth = epsilon.  Integrals are correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: &#039;&#039;&#039;Under standard conditions, water has a density of 1g/ml and its molecular mass is 18.01528g/mol, we can therefore calculate that 1g and thus 1ml contains 3.34 x 10&amp;lt;sup&amp;gt;22&amp;lt;/sup&amp;gt; molecules by dividing the Avogadros constant by the molar mass.&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;Using the molar mass, we can calculate that 1 molecule is equivalent to 2.99 x 10&amp;lt;sup&amp;gt;-23&amp;lt;/sup&amp;gt; ml, and therefore 10,000 molecules would be equivalent to 2.99 x 10&amp;lt;sup&amp;gt;-19&amp;lt;/sup&amp;gt; ml.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;&lt;br /&gt;
** An atom at position (0.5,0.5,0.5) moves to hit the x boundary which causes the x velocity to change in the opposite direction whilst the others remain the same. Later, the atom bounces of the u wall, which causes the y velocity to change direction. As for the z velocity it does not ever change within this timestep. This results in the following:[[File:Task 6.png|850px|thumb|center|&#039;&#039;&#039;Figure 2&#039;&#039;&#039;: Diagrams to show the movement of the atom along the vector, in the single timestep the atom never hits the z boundary but hits both the x and then the y causing the velocitys to change in the opposite direction in both these cases (essentially the atom then bounces back), finishing at position (0.8,0.9,0.7).]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The atom doesn&#039;t bounce off the wall, but instead passes through the wall and re-enters the box from the opposite side, so the final position should be (0.2, 0.1, 0.7)).&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: &#039;&#039;&#039;Using the equation,&amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;,we can convert the LJ cutoff,&amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, to the real units by subbing in the value of &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt;. This gives the answer &amp;lt;math&amp;gt;r = 1.088 \mathrm{nm}&amp;lt;/math&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;We can calculate the well depth in real units by substituting in the values of &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; given/calculated above into the equation &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;.  This gives the well depth &amp;lt;math&amp;gt;E=-6.16\textrm{x}10^{-27}\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;Part 3: &#039;&#039;&#039;Using the equation,&amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;, we can convert the reduced temperature,&amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;, to real units by subbing in the value of &amp;lt;math&amp;gt;\ k_B /\epsilon&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;T = 180\mathrm{K}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The well depth is epsilon, so you just need to convert this into kJ mol-1, part 1 and 3 are correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting  coordinates causes problems in simulations? Hint: what happens if two  atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
** Giving the atoms random starting coordinated causes problems in simulations due to two main reasons. First, if we consider a situation similar to the one we are simulating, two particles in a box, we would expect the particles to spread to opposite sides of the box due to repulsive forces, this of course does not happen when the atoms are given random starting coordinates and would result in the total energy being increased. Secondly, random coordinates can lead to the atoms being placed in positions where they overlap, and this is physically impossible. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: If particles overlap the high repulsive forces can cause the simulation to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point  number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1: &#039;&#039;&#039;By multiplying the x,y and z coordinates provided we can calculate the volume each atom occupies i.e. 1.07722&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; . By then doing the reciprocal of this we can find out the quantity of atoms per unit volume (a.k.a the number density). &amp;lt;math&amp;gt;NumberDensity=\frac{1}{1.07722^{3}}=0.7999&amp;lt;/math&amp;gt;&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;Using the lattice point number density, 1.2, we can calculate the side length of the cubic unit cell by doing the opposite of the above. However this time we must multiply the reciprocal by 3 to account for each unit cell having &amp;lt;math&amp;gt;6\textrm{x}\frac{1}{2}&amp;lt;/math&amp;gt; atoms in it. &amp;lt;math&amp;gt;SideLengthofUnitCell=\sqrt[3]{\frac{1}{1.2}\textrm{x}3}=1.36&amp;lt;/math&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from  the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
** By considering the face-centred cubic lattice we once again consider, as above that the unit cell now contains 3 atoms instead of 1. Thus if we used the create_atoms command having defined the new lattice type we would expect 3000 (3 x 1000) atoms to be created.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The fcc unit cell has 4 atoms in it, not 3.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;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;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
** mass 1 1.0, general form of the function = mass I Value, this function allows the mass of a certain type of atom (I) to be set to at a certain value (Value) &lt;br /&gt;
** pair_style lj/cut 3.0, general form of the function = pair_style style args, pair_style where &#039;style&#039; is lj/cut computes the standard lennard-jones potential with the argument (args) as the cut off&lt;br /&gt;
** pair_coeff * * 1.0 1.0, general form of the function =  pair_coeff I J args, the function allows us to set the pairwise force field coefficients (args) for one or more pairs of atom types (I,J).  The number and meaning of the coefficients depends on the pair style. &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the pair coefficients for a Lennard Jones forcefield?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
** As we are using a canonical system where we want to generate position and velocities using time integration the most suitable integration algorithm is the fix nvt command. More specifically we would most likely use the full command fix 1 all nvt temp x x iso y y, where x is the start/end temperature respectively and y is the start/end pressure. The manual definition of this command is, these commands perform time integration on Nose-Hoover style non-Hamiltonian equations of motion which are designed to generate positions and velocities sampled from the canonical (nvt) ensembles. This updates the position and velocity for atoms in the group each timestep. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
** The code is written as such so as to generalise the formula, so as to allow the user to easily change the timestep without having to manually change it each time.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;Part 1:  &#039;&#039;&#039;The graphs can be analysed easily, the minute differences in temperature and pressure mean we can come to the conclusion that equilibrium is reached after 0.3 seconds even though we would expect energy to be conserved and remain constant at equilibrium. These small fluctuations can be put down to the numerical error of the solution.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: We are using reduced units, time is not in seconds.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;[[File:Screen Shot 2016-12-07 at 15.49.27.png|850px|thumb|center|&#039;&#039;&#039;Figure 3&#039;&#039;&#039;: Graphs to show how energy, temperature and pressure vary with time.]]&lt;br /&gt;
** &#039;&#039;&#039;Part 2: &#039;&#039;&#039;From the graph we can see that the accuracy of the 0.001 and 0.0025 timesteps are very similar, this is closely followed by 0.0075 and 0.01. I would therefore suggest that the ideal timestep to use when doing further simulations would be 0.0025. The 0.015 timestep is a particularly bad choice as the recorded values are completely different to those seen at the higher, more accurate timesteps.&lt;br /&gt;
[[File:Energy Graph.PNG|300px|thumb|center|&#039;&#039;&#039;Figure 4&#039;&#039;&#039;: Graph to show how varying the timestep effects the energy recorded at a certain time.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep.  The average total energy should not depend on the timestep and 0.0025 is the largest timestep which agrees with this.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
** Simulations were undertaken at timestep 0.0025. The temperatures chosen were 2,10,20,30, and 40 and recorded at pressures of 2 and 10.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;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. Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B 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;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
** To solve this we need to essentially equate &amp;lt;math&amp;gt;\gamma^{2} T=\mathfrak{T}&amp;lt;/math&amp;gt;. Using the above equations we get &amp;lt;math&amp;gt;\gamma^{2} T=\frac{\gamma^{2}}{3Nk_{B}}\sum_i m_{i}v_{i}^{2}=\mathfrak{T}&amp;lt;/math&amp;gt;. This can then be equated to get &amp;lt;math&amp;gt;\gamma=\sqrt{\frac{3Nk_{B}\Im}{\sum_i m_{i}v_{^{2}i}}}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Use gamma to scale the velocities so that the target temperature is achieved, gamma should be &amp;lt;math&amp;gt;\gamma=\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
** Part 1: The fix/ave time command,fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2, has the general form: fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ... , from this we can see that the three values, 100, 1000 and 100000 correspond to Nevery, Nrepeat and Nfreq respectively. Nevery in this case means use input values every 100 timesteps. Nrepeat means use the input values for calculating averages 1000 times. Nfreq means calculate averages every 100000 timesteps.&lt;br /&gt;
** Part 2: The following line, run 100000, indicates that the simulation should simulate 100000 timesteps where each timestep is 0.0025 which is equivalent to 250 seconds.&lt;br /&gt;
 &lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen Shot 2016-12-16 at 10.37.09.png|850px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Graph to show how simulation densities compare to those of the ideal gas law. The simulated densitys are higher in both cases, which in turn means that they did not expand as much as the densitys produced by the ideal gas law, the discrepancy as expected increase with pressure. The line of best fit can be seen in all cases to be 1/x which is in line with the ideal gas law,as pV = nRT we would expect T = a constant multiplied by the reciprocal of density.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Is this what you would expect?  The ideal gas has no interactions and so should have a higher density than the simulation results since in the simulations particles repel each other.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities Using Statistical Physics ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-16_at_11.19.11.png|1100px|thumb|center|&#039;&#039;&#039;Figure 6&#039;&#039;&#039;:  Graph to show Heat Capacity/ Volume vs Temperature. The trend is as expected, as the greater the temperature, the closer the energy levels (shown on the right) and so the less heat that would be expected to be required to promote an electron to the next energy level per unit temperature (therefore a lower heat capacity at higher temperatures).]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What about the trend in heat capacity with density?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Example Input Script: Density = 0.2 Temperature = 2.0&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
lattice sc ${d}&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 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;
### SWITCH OFF THERMOSTAT ###&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 atoms equal atoms&lt;br /&gt;
variable etotal equal etotal&lt;br /&gt;
variable etotal2 equal etotal*etotal&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;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_etotal v_etotal2&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 errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable aveetotal equal f_aves[7]&lt;br /&gt;
variable aveetotal2 equal f_aves[8]&lt;br /&gt;
variable heatcapacity equal (${atoms}*${atoms})*(${aveetotal2}-${aveetotal})/(${avetemp}*${avetemp})&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;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-14_at_17.31.52.png|450px|thumb|center|&#039;&#039;&#039;Figure 7&#039;&#039;&#039;: Graph to show the radial distribution function. RDF is probability of finding an atom in a unit space. As we can see the difference between the gas, liquid and solid is clear. The gas atoms are most likely to be very far apart as there is no clear structure whereas for the liquid and the solid the structure is more prominent. We can use a diagram of an FCC latice to picture which atoms, are at which lattice sites and so in turn which is the smallest, 2nd smallest and third smallest distance apart from its nearest neighbour. Using the results we find that distances x1, x2 and x3 are 0.975, 1.425, and 1.725 respectively.Using the distances between the atoms we can then calculate the lattice spacing, this gave 1.425 which is very similar to the initial input parameters. ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The solid RDF has peaks at large distances indicating long range order due to atoms being placed on lattice points.  The liquid has short range order, but no long range order.  Did you try calculating the lattice parameter from the first or third peaks as well?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-14_at_16.55.21.png|450px|thumb|center|&#039;&#039;&#039;Figure 8&#039;&#039;&#039;: Graph to show the integrated radial distribution function. By working out the integral for each peak this allows us to calculate the amount of atoms in these specific position and thus confirm which atoms we are looking at. The results gave 12.00761806, 6.071206595, and 24.08146967 in line with what was predicted.  ]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-15_at_14.29.10.png|800px|thumb|center|&#039;&#039;&#039;Figure 9&#039;&#039;&#039;: Diagram showing the 5 closest atoms relative to the central black atom in the order blue, green, red, yellow and pink. The coordination of the atoms is shown.]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Great diagram to show the nearest neighbour atoms and how many there are at each distance.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
** The solid, liquid and gas simulations were run using the liq.in file adapted to ensure the simulations represented the correct states. Thus density/temperature were set as 1.4/1.5, 0.8/2.0, and 0.1/0.5 respectively.&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: Make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
** The two graphs were plotted and the D calculated by dividing the gradients of the respective lines by 6. This gave the values for the simulation for solid, liquid and gas of 1.66667E-06,0.0003, and 0.0003 respectively. The calculated D values for the given data for solid, liquid and gas respectively were 8.33333E-09,8.33333E-09, and 0.006266667.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-12_at_16.51.15.png|500px|thumb|center|&#039;&#039;&#039;Figure 10&#039;&#039;&#039;: Simulation results for MSD as a function of timestep. We only take the gradients of the linear parts, as for example with the gas we see an initial curve due to diffusion requiring collisions and therefore at this point it is just due to ballistic movement. ]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: It&#039;s strange that the diffusion coefficient for the gas and the liquid are the same.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-12_at_17.01.56.png|500px|thumb|center|&#039;&#039;&#039;Figure 11&#039;&#039;&#039;: Gived data results, gradients taken of the linear parts.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
**Part 1: Evaluation of the integral&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&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(t)=\frac{dx}{dt}&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;C(t)=\frac{\int_{-\infty}^{\infty}{sin(\omega t+\phi)sin(\omega t+\omega\Im+\phi).dt}}{\int_{-\infty}^{\infty}{sin^{2}(\omega t+\phi).dt}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the rule &amp;lt;math&amp;gt;sin(A+B)=sinAcosB+cosAsinB&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;A=\omega t+\phi&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B=\omega\Im&amp;lt;/math&amp;gt; we get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(t)=\frac{\int_{-\infty}^{\infty}{sin(\omega t+\phi)[sin(\omega t+\phi)cos(\omega\Im)+cos(\omega t+\phi)sin(\omega\Im)].dt}}{\int_{-\infty}^{\infty}{sin^{2}(\omega t+\phi).dt}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can bring &amp;lt;math&amp;gt;cos(\omega\Im)&amp;lt;/math&amp;gt; term as it is not with respect to &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;sin^{2}(\omega t+\phi)&amp;lt;/math&amp;gt; of this part then cancels leaving us with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(t)=cos(\omega\Im)+\frac{\int_{-\infty}^{\infty}{sin(\omega t+\phi)cos(\omega t+\phi)sin(\omega\Im).dt}}{\int_{-\infty}^{\infty}{sin^{2}(\omega t+\phi).dt}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By subbing in &amp;lt;math&amp;gt;\alpha=\omega t+\phi&amp;lt;/math&amp;gt; must also multiply &amp;lt;math&amp;gt;dt&amp;lt;/math&amp;gt; by &amp;lt;math&amp;gt;\frac{d\alpha}{dt}=\omega&amp;lt;/math&amp;gt;. As this is done for both the top and bottom equation the &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt; cancel out. This in turn gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(t)=cos(\omega\Im)+sin(\omega\Im)\frac{\int_{-\infty}^{\infty}{sin(\alpha)cos(\alpha).d\alpha}}{\int_{-\infty}^{\infty}{sin^{2}(\alpha).d\alpha}}&amp;lt;/math&amp;gt;, the top of the equation is equivalent to &amp;lt;math&amp;gt;\frac{1}{2}sin2\alpha&amp;lt;/math&amp;gt; and the bottom &amp;lt;math&amp;gt;sin^{2}(\alpha)&amp;lt;/math&amp;gt;. By plotting the graphs of these we can see that the numerator remains finite and the denominator tends to infinite. &lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-11_at_19.19.24.png|850px|thumb|center|&#039;&#039;&#039;Figure 12&#039;&#039;&#039;: Google plots of the functions in the integrals so that we can generalise what the solution to the integral will be]]&lt;br /&gt;
&lt;br /&gt;
Thus the fraction will tend to 0, leaving us with the solution to the integral which is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(t)=cos(\omega\Im)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Nice, clear derivation, sin(x)cos(x) is an odd function, so integrating it between limits which are symmetric about zero will always give zero.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-13_at_14.28.15.png|600px|thumb|center|&#039;&#039;&#039;Figure 5&#039;&#039;&#039;: Simulation VACFs. The minima in both the liquid and solid VACFs show the atoms post collision going in the opposite direction (as we are plotting vectors). Discuss the origin of the differences between the liquid and solid VACFs. The differences in the liquid and solid VACFs are down to the freedom of movement, if we go to the extremes we can look at solid and gas, in a gas there is lots of space between atoms and time between atom collisions, thus it takes a long time to plateau, whereas in a solid atoms are very close together and therefore the system equilibrates quickly.  The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid as we are only looking at one atom instead of a whole system, we can think of the gas, liquid and solid  graphs as being thousands of harmonic oscillators, they start of in sync but as time continues collisions take place and slowly the oscillations cancel out to give an average of zero. ]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
** The trapezium rule was used to approximate the integral under the VACF&#039;s of the solid, liquid and gas. This was done over the 5000 timesteps recorded and gave values of D of 0.32166729, 69.50449871 and 99.90146693 respectively. For the million atom simulations the values of D calculated were 0.022764742,45.04573814 and 1634.232899 respectively. The plots of the running integrals of each are provided below. Biggest source of error is either the trapezium rule or the time recorded for. The use of these graphs is to understand at what point the data begins to plateau and thus at which point is sensible to calculate the integral and thus the diffusion.&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-13_at_14.43.00.png|850px|thumb|center|&#039;&#039;&#039;Figure 13&#039;&#039;&#039;: Simulated Running Integrals]]&lt;br /&gt;
&lt;br /&gt;
[[File:Screen_Shot_2016-12-13_at_14.39.04.png|850px|thumb|center|&#039;&#039;&#039;Figure 14&#039;&#039;&#039;: Provided Data Running Integrals]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Running integral graphs and diffusion coefficient look good.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:BN1418&amp;diff=580165</id>
		<title>Talk:Mod:BN1418</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:BN1418&amp;diff=580165"/>
		<updated>2017-02-03T17:23:33Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Some answers missing, especially for the rdf section, and a few mistakes.  Try to add a bit more detail and background theory...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: Some answers missing, especially for the rdf section, and a few mistakes.  Try to add a bit more detail and background theory into your explanations and make sure that your results make sense and are what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Boglarka&#039;s Computational Lab: &#039;&#039;Molecular dynamics simulations of simple liquids&#039;&#039; =&lt;br /&gt;
&lt;br /&gt;
== Introduction &amp;amp; Running the first simulation ==&lt;br /&gt;
&amp;lt;blockquote&amp;gt;In this section,some trial simulations were run with various time steps: 0.001, 0.0025, 0.0075, 0.01 and 0.015, through the High Performance Computing (HPC) systems. The output of these calculations carried out with the LAMMPS software is presented an discussed in the section below.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction to molecular dynamics simulation ==&lt;br /&gt;
In this section of the experiment, the calculations carried out in the Introduction section are presented and processed, after investigating some of the background Theory. &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 1&amp;lt;/big&amp;gt;: &amp;quot;Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, &amp;quot;ERROR&amp;quot; should contain the &#039;&#039;absolute&#039;&#039; difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this task, the absolute error between the analytical solution to the position of the atom (given by the Classical Particle Approximation in the task, and completed for all time-steps with a given x(t) ) and the solution obtained through the use of the Velocity-Verlet  Algorithm was calculated.              &lt;br /&gt;
&lt;br /&gt;
The plots below show the graphical output of the calculations of the position of the atom using both the Classical Particle Approximation and the the total Energy calculated from the value of v(t) from the Velocity-Verlet Algorithm, as given by E = 0.5m(v(t)^2)).                         &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
![[File:Image to show comparison of velocity verlet and analytical.JPG|thumb|Plot to show comparison of velocity-verlet and analytical calculations|367x367px]]&lt;br /&gt;
![[File:Image to show energy as a function of time.JPG|thumb|437x437px|Plot to show Energy as a function of Time]]&lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 2&amp;lt;/big&amp;gt;: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
[[File:Image to show plot of absolute error as a function of time v2.JPG|thumb|469x469px|Plot to show Absolute Error as a function of Time with linear line of best fit|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;As shown in the plot above, the maxima are at time 2, 4.8, 8 and 11.1. The function fitted to the Energy plot was done using Excel software was a combination of logarithmic, power and moving average, while the line of best fit for the maxima was determined to be linear, with the equation displayed in the plot above.  &lt;br /&gt;
&lt;br /&gt;
As can be seen from the plot, the error becomes more significant for each oscillation, due to the fact that each calculation uses the result obtained from the previous one.                                                                                                                                                            &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 3&amp;lt;/big&amp;gt;: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To ensure that the energy does not change by more than 1% over the course of the simulation, the time step should be &#039;&#039;&#039;0.3&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
This was determined through a trial and error approach with the above value corresponding to a variation of 1%. &lt;br /&gt;
&lt;br /&gt;
Ideally, the largest possible time step would be used in Molecular Dynamics Studies in order to stimulate for the longest possible time, though the smaller the time step, the smaller the error due to fluctuations. The balance is struck on the basis that small time steps increase the time taken for the calculations to be run (in more complex cases than this task of course). &lt;br /&gt;
&lt;br /&gt;
It is of great importance to monitor the total energy of the physical system when modelling the behaviour numerically because we aim to be at equilibrium: significant fluctuations in energy would demonstrate this wasn&#039;t the case.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Energy should be conserved so the total energy should be as constant as possible.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 4:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? 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;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:BN lennard jones.JPG|frameless|850x850px]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The energy at r0 is zero, but the force is the derivative or gradient of the potential energy and is not zero at r0.  All other maths correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 5&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:BN Equation 1.JPG|frameless]][[File:Equation 2 BN.JPG|frameless|749x749px]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 6&amp;lt;/big&amp;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;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The atom would end up at (0.2, 0.1, 0.7) after applying the periodic boundary conditions. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 7&amp;lt;/big&amp;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;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equation 4 BN.JPG|frameless|401x401px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 8&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random starting coordinates causes problems in simulations because there is the possibility that bonding interactions could occur, should two atoms happen to be generated close together. &lt;br /&gt;
&lt;br /&gt;
This can be prevented by placing the atoms on lattice points of a simple cubic lattice.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The Lennard Jones potential only accounts for intermolecular forces and so atoms cannot form bonds.  If atoms are placed very close together the high repulsive forces can make the simulation crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 9&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number Density&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikipedia.org/wiki/Number_density&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; is defined as the number of specified objects per unit volume, and as such for a density of 0.8 and 2 atoms per body centred cubic lattice, this gives a volume of 2.5 reduced units per unit cell. This corresponds to a lattice spacing of 1.07722 as related by its Atomic packing factor&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikipedia.org/wiki/Atomic_packing_factor&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
While for a face-centred cubic lattice with lattice point number density of 1.2 the side length of the unit cell is 1.063, obtained by taking the cube root of the density. &lt;br /&gt;
 &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 10&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The face centred cubic lattice has 4 lattice points (here, atoms) per unit cell, and therefore creating 1000  fcc unit cells generates 4000 lattice points (atoms). &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 11&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;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&amp;lt;/pre&amp;gt;&amp;lt;u&amp;gt;Line 1&amp;lt;/u&amp;gt;: &amp;lt;code&amp;gt;mass I value&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;I&amp;lt;/code&amp;gt; defines the atom type while &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt; allows us to input the mass &lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Line 2&amp;lt;/u&amp;gt;: &amp;lt;code&amp;gt;pair_style style args&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; as  &amp;lt;code&amp;gt;lj/cut, this &amp;lt;/code&amp;gt; indicates the standard 12/6 Lennard Jones potential [[File:Equation 6 BN.gif|frameless|156x156px]]&lt;br /&gt;
&lt;br /&gt;
while &amp;lt;code&amp;gt;3.0 &amp;lt;/code&amp;gt;shows the list of arguments, here a 3.0 (reduced units) cut-off distance&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Line 3&amp;lt;/u&amp;gt;: &amp;lt;code&amp;gt;pair_coeff I J args &amp;lt;/code&amp;gt;specifies the the pairwise standard forcefiled coefficients for one or more pairs of atom types, with * indicating 1 to N&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the forcefield coefficients for the Lennard Jones forcefield?  Why do we use a cutoff?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 12&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We will be using the Velocity-Verlet Integration algorithm beacuse we have been given the initial position and velocity.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 13&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&amp;lt;/pre&amp;gt;It is much better practice, when writing code, to define a value as a variable (e.g. 1000 as the timestep). This is because this then allows for the quicker and easier modification of this value, and without it there could be the risk of errors forgetting to change one of the values further down in the code.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 14&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
![[File:BN Energy against time timestep - 0.001.JPG|frameless|523x523px]]&lt;br /&gt;
![[File:BN Temperature against time timestep - 0.001.JPG|frameless|512x512px]]&lt;br /&gt;
![[File:BN Pressure against time timestep - 0.001.JPG|frameless|530x530px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These graphs above show the energy, temperature and pressure against time for the 0.001 timestep experiment. The simulation does reach equilibrium in under 1 reduced time units , as shown by the values fluctuating around a mean value for each graph after this. Below, the graph to show energy against time at all steps is shown.   &lt;br /&gt;
[[File:BN Energy against time all timesteps.JPG|centre|thumb|608x608px|Graph to show Energy against time at all timesteps]]&lt;br /&gt;
From this, it can be seen that the largest timestep to give acceptable results is 0.01 because although the mean around which the fluctuation occurs is slightly higher than the other, smaller, timesteps, it is still linear, and does not increase over time, i.e. it has equilibriated. This is what makes the 0.015 timestep a particularly bad choice: the energy does not stay constant over time.   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the choice of timestep as it does for 0.0075 and 0.01.  Both 0.0025 and 0.001 give the same average total energy, so the best choice is the larger of these two values - 0.0025.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running simulations under specific conditions ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 15&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 16&amp;lt;/big&amp;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:&#039;&#039;&#039;&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;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The solution for the task is provided below, making use of the fact that gamma is a constant.&lt;br /&gt;
&lt;br /&gt;
[[File:BN Gamma derivation.JPG|frameless|331x331px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 17&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = N every = use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = N repeat = the number of times to use input values for calculating averages &lt;br /&gt;
&lt;br /&gt;
100000 = N frequency = calculate the average this frequently&lt;br /&gt;
&lt;br /&gt;
So running 100,000 atoms, taking input values every 100 timesteps, 1000 will be simulated. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What does this mean?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 18&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Graph_to_show_Density_against_pressure_p_2.5.PNG|frameless|488x488px]][[File:BN density as a function of temperature with ideal gas p=2.8.JPG|frameless|422x422px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The simulated density is at lower height than that shown by the Ideal Gas Equation. This is because the Ideal Gas Equation does not take into account any intermolecular forces. For the Lennard-Jones atoms, there is repulsion between them, so they are packed less tightly than that of the Ideal Gas. &lt;br /&gt;
&lt;br /&gt;
At higher pressures, the atoms are  forced to be even closer: in the LJ simulation, there isn&#039;t as much change in density as for an ideal gas, because the repulsions present between atoms prevent the increase to a great extent. In contrast, the atoms in the ideal gas can rearrange themselves to be more tightly packed, creating the increase in discrepancy.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, how does the discrepancy between simulation and ideal gas results change with temperature and pressure?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 19&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
[[File:BN Graph to showheat capacity against temperature.JPG|centre|thumb|729x729px|Graph to showheat capacity against temperature at Denisty 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
The link to the log script is [[:File:BN Heat cap d 0.8 t 2.2.in|here]] &lt;br /&gt;
&lt;br /&gt;
The trend can be seen to be that the higher the density, the greater the heat capacity at each of the temperatures. &lt;br /&gt;
&lt;br /&gt;
Increasing the density increases the number of particles per unit volume, and so this greater number of particles needs more energy to be thermally excited (i.e. a higher heat capacity).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good, did you have any ideas about the trend in heat capacity with temperature?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 20&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
[[File:RDF plot.JPG|none|thumb|656x656px]][[File:BN Integral of rdf plot.JPG|frameless|662x662px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;g(r) is the radial distribution function, and in the graph above this is measured for a gas, liquid and solid simulation. It shows the structure of a system, being a measure of the probability of finding a particle at a distance of r from a reference particle (relative to an ideal gas particle). Qualitatively, it can be seen that the solid has the greatest number of neighbours: it&#039;s separation and peak heights are characteristic of its ordered lattice structure, the fcc lattice. This is expected because it is the most densely packed, and has the most collisions with other atoms. &lt;br /&gt;
Liquid, as expected, has a more greatly fluctuating RDF than gas due to its denser structure, but less so than that of a solid. &lt;br /&gt;
&lt;br /&gt;
The integral of g(r) shows the degree of order in each of the phases: with the values confirming: solid, liquid, gas in decreasing atomic order.  &lt;br /&gt;
&lt;br /&gt;
Each peak corresponds to a coordination shell. The first three peaks in the fcc solid case correspond to &lt;br /&gt;
&lt;br /&gt;
1. the atom in the face centre from the reference atom placed arbitrarily in the corner of the unit cell&lt;br /&gt;
&lt;br /&gt;
2. the two adjacent corners (longer, so at greater separation value) &lt;br /&gt;
&lt;br /&gt;
3. the opposite face centred atom (having the greatest separation).&lt;br /&gt;
&lt;br /&gt;
The coordination number of the lattice is the number of nearest neighbours. For fcc, this is 12&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://en.wikipedia.org/wiki/Coordination_number&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, and the simulation shows this also, by numerical integration under the first peak (the first coordination shell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The solid g(r) has peaks at large r indicating long range order, the liquid has peaks at short distance indicating some short range order, but no long range order.  How did you calculate the number of atoms responsible for each peak, try zooming in to the integral of g(r) to see what the integral of the first 3 peaks is.  Did you calculate the lattice parameter?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 21&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this section, simulations have been run to calculate the mean squared displacement and velocity auto-correlation function of the system at vapour, liquid and solid. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 22&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|Calculations Carried Out Using HPC Portal, fcc 0.8 density&lt;br /&gt;
|Observations&lt;br /&gt;
|Estimate of D (in reduced units)&lt;br /&gt;
|Calculations carried out from 1 million atom simulations (provided)&lt;br /&gt;
|Estimate of D (in reduced units) for 1 million atoms&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Gas Mean Squared Displacement Plot v2.JPG|centre|thumb|361x361px|Gas Mean Squared Displacement Plot]]&lt;br /&gt;
|It can be seen that we need a longer time to capture the long-time diffusive behaviour of a a gas as its&lt;br /&gt;
mean free path is longer &lt;br /&gt;
&lt;br /&gt;
than of the liquid. Here it is initially under a ballistic regime,with no collisions taking place, due to&lt;br /&gt;
&lt;br /&gt;
the gas atoms being far from each other.&lt;br /&gt;
&lt;br /&gt;
|1.44E-2&lt;br /&gt;
|[[File:Gas Mean Squared Displacement Plot 1 million.JPG|centre|thumb|332x332px|Gas Mean Squared Displacement Plot for 1 million atoms]]&lt;br /&gt;
|6.03E-3&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Liquid Mean Squared Displacement Plot v2.JPG|centre|thumb|367x367px|Liquid Mean Squared Displacement Plot]]&lt;br /&gt;
|MSD is shown to grow linearly&lt;br /&gt;
with time.&lt;br /&gt;
|1.67E-4&lt;br /&gt;
|[[File:Liquid Mean Squared Displacement Plot 1 million atoms.JPG|centre|thumb|365x365px|Liquid Mean Squared Displacement Plot for 1 million atoms]]&lt;br /&gt;
|1.67E-4&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Solid Mean Squared Displacement Plot v2.JPG|centre|thumb|371x371px|Solid Mean Squared Displacement Plot]]&lt;br /&gt;
|The mean free path for a solid &lt;br /&gt;
&lt;br /&gt;
is very short: the diffusion is&lt;br /&gt;
&lt;br /&gt;
expected to be very small.&lt;br /&gt;
|6.66E-9&lt;br /&gt;
|[[File:Solid Mean Squared Displacement Plot 1 million.JPG|centre|thumb|370x370px|Solid Mean Squared Displacement Plot for 1 million atoms]]&lt;br /&gt;
|1.67E-8&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 23&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:BN velocity autocorrection function.JPG|frameless|732x732px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The integration can be avoided by recognising the numerator as a mixture of odd and even functions and canceling the integrals accordingly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:BN VACF Graph liquid solid and 1D harmonic oscillator.JPG|left|thumb|1025x1025px|Graph to show VACF for Liquid, Solid and HO]]The plot on the left shows the VACF for Liquid, Solid and Harmonic Oscillator. As the velocity auto-correlation function (VACF) is averaged over time and atoms, the plot for solid and liquid can be seen to be highest at τ = 0 because at this time velocity is v(t)² which has greater value than &amp;lt;v(t) * v(t + τ)&amp;gt; where the velocity at the later time (t + τ) would be different to that at time t and thus leads to a decrease in C(τ).&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF results from the collisions between atoms occuring in the solid and liquid, modelling the oscillation the molecule undergoes in its lattice for example (for the solid).&lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs have differences due to the liquid being a less ordered collection of atoms than a solid. &lt;br /&gt;
&lt;br /&gt;
The HO VASF is very different because it doesn&#039;t take into account the intermolecular interactions that the Lennard-Jones liquid and solid have, which has the effect of randomising their velocities (and thus the mean is fluctuating around, and eventually approaches zero - the positive and negative velocities have the net effect of zero). Therefore the HO has a  constantly oscillating VASF.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK 24&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
[[File:BN_trapezoid.JPG|left|thumb]]&lt;br /&gt;
The Trapezoid Rule is used for the approximation of the integrals over the timesteps used in the simulation.&lt;br /&gt;
&lt;br /&gt;
The integral under the VACF gives the diffusion constant D because the displacement of a particle over an interval t can be obtained by integrating its velocity. &lt;br /&gt;
&lt;br /&gt;
The following plots show the VACF for solid, liquid and gas both for the simulations run and for the 1 million atom simulations, as well as the running integral plots for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VACF&lt;br /&gt;
!VACF for 1 million atoms&lt;br /&gt;
!Plot of running Integral for 1 million atoms (as approximated by the Trapezium Rule)&lt;br /&gt;
|-&lt;br /&gt;
|Liquid[[File:BN_VACF_liquid_simulation.JPG|left|frameless|322x322px]]&lt;br /&gt;
|[[File:BN_VACF_liquid_simulation_1_million_atoms.JPG|left|frameless|414x414px]]&lt;br /&gt;
|[[File:BN VACF gas running integral.JPG|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
|Solid[[File:BN_VACF_solid_simulation.JPG|left|frameless|343x343px]]&lt;br /&gt;
|[[File:BN VACF solid simulation 1 million.JPG|frameless|431x431px]]&lt;br /&gt;
|[[File:BN VACF solid running integral.JPG|frameless]]&lt;br /&gt;
|-&lt;br /&gt;
|[[File:BN VACF gas simulation.JPG|frameless|277x277px]]&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
|[[File:BN VACF gas simulation 1 million atoms.JPG|frameless|409x409px]]&lt;br /&gt;
|[[File:VACF gas running integral BN.JPG|frameless|310x310px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the integral of the solid VACF increase rather than flattening out, and why does it give such a large diffusion coefficient?  The plots of the VACF look good, so maybe there is a mistake in the calculation of the running integral?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient, D is given by&lt;br /&gt;
&lt;br /&gt;
[[File:BN diffusion coefficient equation.JPG|frameless]] &lt;br /&gt;
&lt;br /&gt;
and the values are tabulated below&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
!&lt;br /&gt;
!approximate D value&lt;br /&gt;
as obtained by the Trapezium Rule&lt;br /&gt;
|-&lt;br /&gt;
|Gas&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|1.52E03&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4.50E01&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|4.00E07&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
With the great difference in D for the solid due to the nature of the approximation: there is great over-estimation of the area at each step through the use of the trapezium rule.&lt;br /&gt;
&lt;br /&gt;
Discussion of the VACF graphs:&lt;br /&gt;
&lt;br /&gt;
The plots to show  the velocity auto-correlation functions show how it varies over time: the gas is observed to vary differently from the liquid or solid due to its much greater molecular disorder: it does not have the minima like the solid and liquid since collisions don&#039;t occur as frequently. &lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:sfs114&amp;diff=579856</id>
		<title>Talk:Mod:sfs114</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Mod:sfs114&amp;diff=579856"/>
		<updated>2017-02-02T03:49:16Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes and some answers could have done with a bit more detail.  Make sure you understand the...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks attempted, but a few mistakes and some answers could have done with a bit more detail.  Make sure you understand the theory behind the tasks and ask yourself whether your results are what you would expect.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
=== Numerical Integration ===&lt;br /&gt;
&lt;br /&gt;
The classical solution for the position at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; compares well with the velocity-Verlet solution:&lt;br /&gt;
&lt;br /&gt;
[[File:Classicalsolution1.jpg|thumb|centre|800px|A plot of x(t) against t comparing analytical and velocity-Verlet solutions]]&lt;br /&gt;
&lt;br /&gt;
The total energy for the oscillator varies as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Energy111.jpg|thumb|centre|800px|A plot of energy against time]]&lt;br /&gt;
&lt;br /&gt;
An approximate linear fit has been performed on the maxima of the error of the calculations; the absolute difference between classical and velocity-Verlet solutions. Iterations of using previous results causes error to propagate and increase. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the error oscillate?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Errorfit.jpg|thumb|centre|800px|A plot of absolute error, with a linear function fitted to the error maxima]]&lt;br /&gt;
&lt;br /&gt;
The smaller the timestep, the smaller fluctuations in total energy. Calculations over larger timesteps causes a greater error, as particles could end up too close together and face extremely large forces, for example. It is important to monitor the total energy of a physical system to ensure energy is conserved, however infinitesimal timesteps greatly increase time needed to run simulations. Larger timesteps allow a longer length of time to be simulated. A timestep of &#039;&#039;&#039;0.028s&#039;&#039;&#039; allows energy fluctuations to be as low as &amp;lt;math&amp;gt;\plusmn 1%&amp;lt;/math&amp;gt; of the average value.&lt;br /&gt;
&lt;br /&gt;
[[File:energytimestep.jpg|thumb|centre|600px|Energy oscillation with a timestep of 0.028s]]&lt;br /&gt;
[[File:energytimestep2.jpg|thumb|centre|600px|Energy oscillation with a timestep of 0.5s]]&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
&lt;br /&gt;
For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi (r) = 4\epsilon (\frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* When potential energy is 0, &amp;amp;phi;(r) = 0 and r=r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;&lt;br /&gt;
::If &amp;lt;math&amp;gt;\phi=0, (\frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6}) = 0&amp;lt;/math&amp;gt;,&lt;br /&gt;
:::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r^{12}} = \frac{\sigma^{6}}{r^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:*The force is given by &amp;lt;math&amp;gt;F= \frac{d\phi}{dr}=4\epsilon(-12\sigma^{12}r^{-13}+6\sigma^{6}r^{-7})&amp;lt;/math&amp;gt; and at a potential energy of 0, &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:*At equilibrium separation &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\frac{d\phi}{dr}=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
::&amp;lt;math&amp;gt;0=4\epsilon(\frac{-12\sigma^{12}}{r^{13}}+\frac{6\sigma^6}{r^7})&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(\frac{12\sigma^{12}}{r^{13}} = \frac{6\sigma^6}{r^7})&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;r_{eq}=2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:*At equilibrium separation, the well depth:&lt;br /&gt;
::&amp;lt;math&amp;gt;\phi(r_{eq})=\phi(2^{\frac{1}{6}}\sigma)=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:*&amp;lt;math&amp;gt;\int\phi(r)\, dr=4\epsilon[\frac{-\sigma^{12}}{11r^{11}}+\frac{\sigma^6}{5r^5}]+c&amp;lt;/math&amp;gt; and given that &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt; so &amp;lt;math&amp;gt;\int\phi(r)\, dr=4\left[\frac{-1}{11r^{11}}+\frac{1}{5r^5}\right]+c&amp;lt;/math&amp;gt;&lt;br /&gt;
::*&amp;lt;math&amp;gt;\int\limits_{2\sigma}^{\infty}\phi(r)\, dr=4\left[\frac{-1}{11r^{11}}+\frac{1}{5r^5}\right]_2^{\infty} = -4(\frac{1}{5(2)^5}-\frac{1}{11(2)^{11}}) = -0.02482&amp;lt;/math&amp;gt;&lt;br /&gt;
::*&amp;lt;math&amp;gt;\int\limits_{2.5\sigma}^{\infty}\phi(r)\, dr=4\left[\frac{-1}{11r^{11}}+\frac{1}{5r^5}\right]_{2.5}^{\infty} = -4(\frac{1}{5(2.5)^5}-\frac{1}{11(2.5)^{11}}) = -0.008177&amp;lt;/math&amp;gt;&lt;br /&gt;
::*&amp;lt;math&amp;gt;\int\limits_{3\sigma}^{\infty}\phi(r)\, dr=4\left[\frac{-1}{11r^{11}}+\frac{1}{5r^5}\right]_{3}^{\infty} = -4(\frac{1}{5(3)^5}-\frac{1}{11(3)^{11}}) = -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clear.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt; pV=Nk_BT &amp;lt;/math&amp;gt;, the number of water molecules in 1 mL of water is approximately &amp;lt;math&amp;gt;2.46x10^{19}&amp;lt;/math&amp;gt; and 10000 molecules takes up an approximate volume of &amp;lt;math&amp;gt;4.06x10^{-22} m^3&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show more working here, your values are not exactly right.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simulation box which runs from (0,0,0) to (1,1,1), an atom that starts at (0.5,0.5,0.5) and moves along vector (0.7,0.6,0.2), will end up at &#039;&#039;&#039;(0.2,0.1,0.7)&#039;&#039;&#039; once periodic boundary conditions have been applied.&lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
The LJ parameters for Argon are: &amp;lt;math&amp;gt;\sigma=0.34nm, \frac{\epsilon}{k_B}=120K&amp;lt;/math&amp;gt;.&lt;br /&gt;
*&amp;lt;math&amp;gt;r=\sigma \cdot r*= 0.34 \cdot 3.2 = 1.088 nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
*&amp;lt;math&amp;gt; Well Depth = \phi(r_{eq}) = - \epsilon = - k_B \cdot 120 = -1.656^{-21}J&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;-1.656^{-21} \cdot N_A = -997.4 = -0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;.&lt;br /&gt;
*&amp;lt;math&amp;gt;T=\frac{\epsilon \cdot T*}{k_B}=120 \cdot 1.5 = 180 K&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibriation ==&lt;br /&gt;
&lt;br /&gt;
=== Creating the Simulation Box ===&lt;br /&gt;
&lt;br /&gt;
If two atoms are generated too close together, the LJ potential shows that the potential between the two would be infinitely large, making force simulations between these two atoms too large to realistically simulate. The LJ cutoff also ensures that LJ potentials are only calculated for atoms that are near enough, and not every other atom in the infinitely repeating lattice, which would greatly increase simulation run time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Large repulsive forces cause the simulation to crash.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A lattice spacing of 1.07722 corresponds to a lattice number density of &amp;lt;math&amp;gt;\frac{1}{1.07722^3}=0.8&amp;lt;/math&amp;gt; for a simple cubic lattice. A face centred cubic lattice has 4 lattice points per cell, and thus would require a lattice spacing of &amp;lt;math&amp;gt; (\frac{4}{1.2})^{\frac{1}{3}}= 1.4938&amp;lt;/math&amp;gt;. A 10x10x10 box would contain 1000 unit cells, and 4000 lattice points, so the create_atoms command for such a lattice would create 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
&lt;br /&gt;
The command &#039;&#039;&#039;mass 1 1.0&#039;&#039;&#039; assigns all atoms of type 1 a mass of 1.0.&lt;br /&gt;
The command &#039;&#039;&#039;pair_style lj/cut 3.0&#039;&#039;&#039; defines the cutoff distance between atoms that have a potential between them to be 3.0 (ie. the simulation does not run for atoms farther apart or closer than this distance).&lt;br /&gt;
The command &#039;&#039;&#039;pair_coeff ** 1.0 1.0&#039;&#039;&#039; specifically defines the pairwise force field coefficients for multiple pairs atoms.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean &amp;quot;the simulation does not run for atoms farther apart or closer than this distance&amp;quot;?  The force field parameters for a Lennard Jones simulation are epsilon and sigma.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The velocity-Verlet algorithm is the numerical integration method that will be used if &amp;lt;math&amp;gt;x_i(0)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i(0)&amp;lt;/math&amp;gt; are defined.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
Calling upon variables, instead of assigning numbers, makes it much easier to change these variables for every simulation that is run.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibriation ===&lt;br /&gt;
&lt;br /&gt;
The simulation takes about 0.3 seconds to equilibriate energy, temperature, and pressure, as shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:energyeq.jpg|thumb|400px|left|Energy equilbriation]] &lt;br /&gt;
[[File:energyeqzoom.jpg|thumb|400px|right|Closer look at energy equilibriation]]&lt;br /&gt;
[[File:tempeq.jpg|thumb|400px|left|Temperature equilbriation]]&lt;br /&gt;
[[File:tempeqzoom.jpg|thumb|400px|right|Closer look at temperature equilibriation]]&lt;br /&gt;
[[File:presseq.jpg|thumb|400px|left|Pressure equilbriation]]&lt;br /&gt;
[[File:presseqzoom.jpg|thumb|400px|right|Closer look at pressure equilibriation]]&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibriation3.jpg|thumb|800px|centre|Energy equilibriation for multiple timesteps]]&lt;br /&gt;
Of the five timsteps used, 0.0025 is the largest acceptable timestep to use as a smaller timestep of 0.001 results in a very similar equilibriation, so going this small is not necessary. 0.015 does not equilbriate at all as the time steps are too large for the numerical integration to accurately find an average for the ensemble, and energy drifts; diverging instead of converging to an average value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good choice of timestep, but why not 0.0075 or 0.01?  Should the average total energy depend on the choice of timestep?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions ==&lt;br /&gt;
&lt;br /&gt;
=== Thermostats &amp;amp; Barostats ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E_K = \frac{3}{2} Nk_B\mathfrak{T} = \frac{1}{2}\sum_{i} m_i (\gamma v_i)^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \gamma^2 = \frac{\frac{3}{2}Nk_B\mathfrak{T}}{\frac{1}{2}\sum_{i}m_i v_i^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \gamma^2 = \frac{\frac{3}{2}Nk_B\mathfrak{T}}{\frac{3}{2}Nk_BT}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \gamma = (\frac{\mathfrak{T}}{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 command &#039;&#039;&#039;fix aves all ave/time 100 1000 100000&#039;&#039;&#039; means that values will be sampled every 100 timesteps; in total 1000 readings will be taken to compute a final average on the 100000th timestep.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;run 100000&#039;&#039;&#039; indicates that 100000 timesteps will be simulated.&lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
[[File:download1.jpg|thumb|center|800px|A plot of density against temperature compared to ideal gas law]]&lt;br /&gt;
&lt;br /&gt;
Higher pressures lead to higher densities, both in theory and in these simulations. Our simulated density is higher than that given by the ideal gas law because the simulation takes particle interactions into account. The error increases at higher pressures, when more collisions are likely to occur, while lower pressures would theoretically behave more as an ideal gas would. For the same reason, error decreases at higher temperatures.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Why does the lack of interactions in the ideal gas mean that it has a lower density than the simulations?  The lack of repulsion between particles in an ideal gas should mean that this has a higher density than the simulations.  What value of kB did you use, remember it should be in reduced units to match the simulation data.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities Using Statistical Physics ==&lt;br /&gt;
[[File:HEATCAP.jpg|thumb|centre|800px|A plot of heat capacity/volume against temperature]]&lt;br /&gt;
&lt;br /&gt;
Higher pressure results in higher heat capacity as the increased number of molecules per unit volume that can absorb energy to their vibrational excited states. As the simulation is in a lattice, rotational degrees of freedom are not available to the atoms, and so heat capacity decreases as temperature increases, despite expectations. Alternatively, increasing temperature causes a decrease in band gap, requiring less energy to enter excited states and thus lowering heat capacity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good ideas, more analysis beyond this experiment would be needed to properly understand this trend.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
An example of the input scripts is below:&lt;br /&gt;
&lt;br /&gt;
[[Media:inputnpt.in]]&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
[[File:RDF1.jpg|thumb|centre|800px|A plot of RDFs]]&lt;br /&gt;
&lt;br /&gt;
The RDF shows the probability of finding a particle at a distance r from a reference particle, relative to an ideal gas. In a gas, there is little order and minimal structure to particles and so the graph has minimal features. &lt;br /&gt;
&lt;br /&gt;
Liquids are slightly more ordered and the decreasing heights of peaks of the RDF correlate to coordination spheres. There is a high probability of finding another particle in a primary coordination sphere but this probability decreases as you go farther away from the reference particle, indicated by decreasing heights of peaks.&lt;br /&gt;
&lt;br /&gt;
The solid FCC lattice has a much higher order, and the RDF peak separation and heights define the lattice structure. The first, second, and third sharp peaks refer to different sets of nearest neighbours, while their heights show how many of those nearest neighbours there are. The lattice spacing is the same as the distance to the second nearest neighbour, 1.475. This agrees well with the original input density of 1.3 (which should result in a lattice spacing of 1.45).&lt;br /&gt;
&lt;br /&gt;
[[File:nearestn.jpg|thumb|centre|400px|A diagram of first (left) and second (right) nearest neighbours (shown in blue) with respect to a reference particle (red) in an FCC lattice (other atoms shown in black)]]&lt;br /&gt;
[[File:nearestn3.jpg|thumb|centre|250px|A diagram of third nearest neighbours (blue) with respect to a reference particle (red) in an FCC lattice (other atoms shown in black)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Int1.jpg|thumb|centre|600px|A plot of the running integral of the RDF of a solid]]&lt;br /&gt;
&lt;br /&gt;
The coordination numbers are 12 (Int(g(1.205)=12, 12 neighbours), 6 (Int(g(1.475)=18, 18-12=6 neighbours), and 24 (Int(g(1.775)=42, 42-18=24 neighbours) respectively.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanation of your results and nice use of fcc diagram.  Could you have calculated the lattice spacing from the first and third peak as well and then taken an average?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
&lt;br /&gt;
=== Mean Squared Displacement ===&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{solid} = \frac{1}{6} \cdot 0.00382752458475 = 6.38x10^{-4}&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{liquid} = \frac{1}{6} \cdot 0.509774821123 = 0.085&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{gas} = \frac{1}{6} \cdot 7.99193006423 = 1.33&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient increases as entropy of the phase increases, which matches expectations as gas particles are much more likely to diffuse than a rigid lattice of solid molecules.&lt;br /&gt;
&lt;br /&gt;
[[File:solid.jpg|thumb|centre|Total MSD as a function of time of simulated solid]]&lt;br /&gt;
[[File:liquid1.jpg|thumb|centre|Total MSD as a function of time of simulated liquid]]&lt;br /&gt;
[[File:gas11.jpg|thumb|centre|Total MSD as a function of time of simulated gas]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 1000000 Atoms ====&lt;br /&gt;
&lt;br /&gt;
[[File:MSD11.jpg|thumb|800px|Total MSD as a function of time for 1000000 atoms]]&lt;br /&gt;
&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{solid} = \frac{1}{6} \cdot 2.79195534196x10^5 = 4.65x10^{-6} &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{liquid} = \frac{1}{6} \cdot 0.531614512766 = 0.0886&amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{gas} = \frac{1}{6} \cdot 18.0968139669 = 3.02&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MSD graph for a gas is curved at first, indicating ballistic motion proportional to &amp;lt;math&amp;gt;T^{2}&amp;lt;/math&amp;gt;. After enough collisions have occurred, diffusion is linear, as it is for a liquid which constantly has the same collisions. The diffusion coefficient is close to 0 for solids which is as expected.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Show the lines of best fit that you&#039;ve used to calculate D on the graphs.  Why does the MSD for your solid data increase over time, is this for an fcc lattice?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Velocity Autocorrelation Function ===&lt;br /&gt;
&lt;br /&gt;
::*&amp;lt;math&amp;gt; x(t)=Acos(\omega t + \phi) &amp;lt;/math&amp;gt;   and   &amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin (\omega t+ \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int\limits_{-\infty}^{\infty}v(t)-v(t+\tau)dt}{\int\limits_{-\infty}^{\infty}v^2(t)dt} =  \frac{\int\limits_{-\infty}^{\infty}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)}{\int\limits_{-\infty}^{\infty}sin^2(\omega t + \phi)dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::*&amp;lt;math&amp;gt; sin(A+B) = sinAcosB + cosAsinB &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{[cos (\omega \tau) \int\limits_{-\infty}^{\infty} sin^2(\omega t + \phi) dt] + [sin (\omega \tau) \int\limits_{-\infty}^{\infty} sin(\omega t + \phi) cos(\omega t + \phi) dt]}{\int\limits_{-\infty}^{\infty}sin^2(\omega t + \phi)dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::*&amp;lt;math&amp;gt; sin^2(x) = \frac{1}{2} (1-cos(2x)) &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{[cos (\omega \tau) \int\limits_{-\infty}^{\infty} \frac{1}{2} (1-cos(2(\omega t + \phi)] + [sin (\omega \tau) \int\limits_{-\infty}^{\infty} sin(\omega t + \phi) cos(\omega t + \phi) dt]}{\int\limits_{-\infty}^{\infty} \frac{1}{2} (1-cos(2(\omega t + \phi) dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::*&amp;lt;math&amp;gt; \int \frac{1}{2} (1-cos(2(\omega t + \phi)) dt = \frac{t}{2} + \frac{sin(2(\omega t + \phi)}{4\omega} + c &amp;lt;/math&amp;gt;&lt;br /&gt;
::*&amp;lt;math&amp;gt; \int sin(\omega t + \phi) cos(\omega t + \phi) dt = \frac{sin^2(\omega t + \phi)}{2\omega} + c&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\left[\frac{tcos(\omega \tau)}{2} + \frac{cos(\omega \tau)sin(2(\omega t + \phi))}{4\omega} + \frac{sin(\omega \tau)sin^2(\omega t + \phi)}{2\omega}\right]_{-\infty}^{\infty}}{\left[\frac{t}{2} +  \frac{sin(2(\omega t + \phi)}{4\omega}  \right]_{-\infty}^{\infty}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::*sin(x) is an odd function and integrating between &amp;lt;math&amp;gt;-\infty&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\infty&amp;lt;/math&amp;gt; will result in 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\frac{tcos(\omega \tau)}{2}}{\frac{t}{2}} = cos (\omega \tau)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: You can simplify the derivation and avoid the intergration if you can identify terms in the integral as odd or even functions and then simplify them accordingly.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VACF minima refer to collisions of particles where velocity is instantaneously 0, negative as they are in the opposite direction. As VACF is averaged over all molecules, they cancel out once they are out of phase, which happens faster for liquids than it does for solids. In comparison to the harmonic oscillator, which only models one particle without any collisions, no convergence to 0 occurs.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF1.jpg|thumb|centre|800px|A plot of total VACF against &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient estimations, using the trapezium rule:&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{solid} = \frac{1}{3} \cdot 0.43184744815700105 = 0.144  &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{liquid} = \frac{1}{3} \cdot 146.83331703729999 = 48.9 &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{gas} = \frac{1}{3} \cdot 1451.848385 =484 &amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:runint4.jpg|thumb|centre|Plot of running integral of VACF of a solid]]&lt;br /&gt;
[[File:runint5.jpg|thumb|centre|Plot of running integral of VACF of a liquid]]&lt;br /&gt;
[[File:runint6.jpg|thumb|centre|Plot of running integral of VACF of a gas]]&lt;br /&gt;
&lt;br /&gt;
==== 1000000 Atoms ====&lt;br /&gt;
[[File:VACF1111.jpg|thumb|centre|800px|A plot of total VACF against &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt; for 1000000 atoms]]&lt;br /&gt;
&lt;br /&gt;
*The trapezium rule estimation of the integral for a solid was found to be -0.416 for 1000000 atoms between 0 and 500. (D would hypothetically equal -0.139)&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{liquid} = \frac{1}{3} \cdot 123.7270701106= 41.2 &amp;lt;/math&amp;gt;&lt;br /&gt;
*&amp;lt;math&amp;gt; D_{gas} = \frac{1}{3} \cdot 1466.443215 = 489 &amp;lt;/math&amp;gt;&lt;br /&gt;
[[File:runint7.jpg|thumb|centre|Plot of running integral of VACF of a solid]]&lt;br /&gt;
[[File:runint8.jpg|thumb|centre|Plot of running integral of VACF of a solid]]&lt;br /&gt;
[[File:runint9.jpg|thumb|centre|Plot of running integral of VACF of a solid]]&lt;br /&gt;
&lt;br /&gt;
The estimated diffusion coefficients for the two simulations follow the same trend, however the values obtained for the larger 1000000 atom simulations are generally smaller. The largest sources of error include the trapezium rules used to calculate the integral and the simulation assumption that velocities do not change upon collisions.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Check captions in these figures.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Cf1014&amp;diff=579603</id>
		<title>Talk:Cf1014</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Cf1014&amp;diff=579603"/>
		<updated>2017-01-31T14:56:31Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments: All tasks answered correctly and good, clear and concise explanations of what your results show, well done.  You could have added a bit more detail to your answers to the last sections on the RDF and dynamics.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By Charlie Farnham&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
Molecular dynamics is the study of the physical movements of particles, using a computer simulation of a N-body simulation.&amp;lt;ref&amp;gt;Alder. B. J, Wainwright. T. E, (1959), &#039;&#039;J. Chem. Phys, &#039;&#039;&#039;&#039;&#039;31 &#039;&#039;&#039;(2), 459, doi: 10.1063/1.1730376&amp;lt;/ref&amp;gt; The method originated in the 1950s and 60s, pioneered by the physicists such as Metropolis and Fermi.&amp;lt;ref&amp;gt;Fermi. E, Pasta. J, Ulam. S, (1955), Los Alamos report LA, doi: ACC0041.pdf&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;N. Metropolis, A.W.Rosenbluth, A.H. Teller, E. Teller, (1953), &#039;&#039;J. Chem. Phys.&#039;&#039; &#039;&#039;&#039;21&#039;&#039;&#039;, 1087, doi: 10.1063/1.1699114. &amp;lt;/ref&amp;gt; While Metropolis and his team had managed to simulate a liquid of imaginary 2D spheres, Fermi was seeking to model forces between neighbouring atoms as a function of time. This type of simulation is extremely important to modern science, a good example being its use in predicting the behavior of biological and drug molecules when in contact with receptors and other bio-molecules.&amp;lt;ref&amp;gt;M. Karplus, R. Lavery, (2014), &#039;&#039;Computational Molecular Biophysics&#039;&#039;, &#039;&#039;&#039;54&#039;&#039;&#039;, 1042–1051, doi: 10.1002/ijch.201400074. &amp;lt;/ref&amp;gt; In this particular lab, use of the velocity-Verlet algorithm is employed to consider both starting positions and initial velocities of all atoms in a defined region. The significance of timestep values is explored and the Lennard-Jones interactions of pairs of atoms are considered to simulate and investigate real molecular dynamics. &lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator Demonstration ===&lt;br /&gt;
Initially, this section analyses the discrepancy between modelling a classic harmonic oscillator when using the classic solution and when using the velocity-Verlet algorithm solution. The position at time t for a classic harmonic oscillator is given by the following equation: &lt;br /&gt;
[[File:Pics of eqa.png|frameless|centre]][[File:Error graph for classic vs verlet algorithm with maxima trend.png|thumb|872x872px|Graph of absolute error between classic and Verlet algorithm solutions of position of a harmonic oscillator. |none]]Looking at the blue absolute error graph above, it can be seen that the error oscillates between 0 and an ever increasing maximum. This is explained by considering that the classical and velocity-verlet solutions are themselves sine waves, that at given times, regardless of their phase will intercept (resulting in a discrepancy of 0 at that given time). Observing the orange error maxima trend line it can be seen that total error increases as a function of time. This is because the errors with each sequential calculation are accumulative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good understanding.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:X versus t classic graph.png|thumb|746x746px|Graph of position versus time for the displacement of a &lt;br /&gt;
harmonic oscillator using classical solution.|none]]&lt;br /&gt;
[[File:Total energy velocity verlet sltn graph.png|thumb|739x739px|Graph of Total Energy versus time for the velocity-Verlet algorithm|none]]           &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;It is expected that total energy, consisting of kinetic and potential energy would be constant. A fluctuation in potential energy is coupled with a fluctuation in kinetic energy, resulting in a constant total energy (as one energy decreases it is exchanged into the other). As seen in the graph above, the model is not perfect and there is a negligible fluctuation in total energy. Time step is the number that controls how many calculations are made in a given time. The smaller the time step and therefore the more calculations made in a given time, the more realistic the model but the more difficult the set of calculations. 0.20 is the larger time step that resulted in a maximum error of 1.005% about the average, actual energy value. A time step of 0.19 gave a maximum error 0f 0.904% about the average energy. Clearly, a time step value between 0.19 and 0.20 is required to limit total error to 1.00%. It&#039;s important to monitor the total energy of a physical system when modelling its behaviour numerically because energy in the real system should be conserved and this should be simulated as accurately as possible in the model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The Verlet algorithm is based on a Taylor expansion which is more accurate for a smaller timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
.This is shown in the two graphs below. &lt;br /&gt;
&lt;br /&gt;
[[File:Time step 0.20 biggger than 1 perecent increaeerror graph for classic vs verlet algorithm with maxima trend.png|thumb|690x690px|Graph of Energy  versus time with time step 0.20|none]]&lt;br /&gt;
[[File:Time step 0.19 smaller than 1 perecent increaeerror graph for classic vs verlet algorithm with maxima trend.png|none|thumb|664x664px|Graph of Energy versus time with time step 0.19]]&lt;br /&gt;
&lt;br /&gt;
A time step of less than 0.19 would of course reduce the percentage error, but this would be an unnecessary level of accuracy.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
* For a single Lennard-Jones Interaction, when the potential energy equals 0, the separation (r) is found as follows: &lt;br /&gt;
[[File:Equations for r0 finding sigma.png|thumb|centre]]Since r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;or separation is larger than zero, we know that r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;equals positive sigma.&lt;br /&gt;
* The force at this separation is found as follows:&lt;br /&gt;
[[File:Equations 2ddsd.png|none|thumb]]&lt;br /&gt;
* The equilibrium separation and well depth are found as follows:&lt;br /&gt;
&lt;br /&gt;
At equilibrium separation, force is set equal to zero.&lt;br /&gt;
[[File:Eqm sep and well depth sddd.png|none|thumb]]&lt;br /&gt;
[[File:Well depth init blud.png|none|thumb]]&lt;br /&gt;
* The following integrals are evaluated when &lt;br /&gt;
[[File:Integral conditions.png|none|thumb|157x157px]]This is probing to test at which separation, r, do we no longer consider an interaction between two atoms as significant. Of course, the force between two atoms decreases rapidly with r, and calculating this at infinite distance would be impossible to compute. (A cut off point must be decided, which is a compromise between simulating the real situation as closely as possible and allowing the computer to solve functions within a reasonable time). [[File:Answer to all integral evaluations bro.png|none|thumb|646x646px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
* 1 mL of water equates to 0.056 moles. The total number of water molecules if therefore the product of the number of moles and Avogadro&#039;s constant: N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; x 0.056 = &#039;&#039;&#039;3.34 x 10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt; molecules&#039;&#039;&#039;. &lt;br /&gt;
* 10000 molecules of water equate to 1.66 x 10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt; moles. (10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt;). 1 mole of water occupies 18 mL, &#039;&#039;&#039;so 10000 molecules occupy 2.99 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL&#039;&#039;&#039;.  &lt;br /&gt;
* Considering an atom at position (0.5,0.5,0.5) in a cubic simulation box running from (0,0,0) to (1,1,1). The atom moves along the vector (0.7,0.6,0.2) in a single time step. Without the boundary conditions, the atom would end up at position (1.2, 1.1, 0.7). The conditions mean that when an atom leaves the boundary, it is replaced by a replica atom entering from the opposite face of the boundary. After the periodic boundary conditions have been applied, &#039;&#039;&#039;it ends up at (0.2, 0.1, 0.7).&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
To make values more manageable when using Lennard-Jones interactions, scaling factors are introduced, which convert real units into reduced units.    &lt;br /&gt;
[[File:Real units reduced units final complere.png|none|thumb|572x572px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but makes more sense to give r in nm.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
=== Creating the Simulation Box ===&lt;br /&gt;
* Giving atoms random starting coordinates is likely to cause problems with simulations. This is because many atoms are being generated within a limited space, meaning the likelihood of two atoms overlapping or being very close to each other is high. Looking at the Lennard-Jones equation, we can see that when the inter-nuclear distance is below the equilibrium distance, the energy of the interaction between the two atoms becomes dramatically larger and hence the accuracy of the simulation becomes questionable. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: With high repulsive forces the simulation will crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* There is one lattice point per unit cell. Consider a unit cell with volume 1.07722&amp;lt;sup&amp;gt;3 &amp;lt;/sup&amp;gt; = 1.25. The number density specifies the number of lattice points per unit volume and is given by the equation  p = n/V .[[File:Number density eqn cfarnham.png|none|thumb|160x160px]]&lt;br /&gt;
*Considering a face centred cubic lattice with a lattice point number density of 1.2, the length of the side of the cubic unit cell can be calculated (n = 4 for a face centred cubic lattice).[[File:Volume equatin mate nit.png|none|thumb]]Using the original, simple cubic lattice, a simulated region of 10x10x10 unit cells contains 1000 atoms (as there is 1 atom/lattice point in each unit cell). If this were defined for the face centred cubic lattice with the same dimensions instead, &#039;&#039;&#039;it would be found that the region contained 4000 atoms&#039;&#039;&#039;, as each unit cell has 4 atoms/lattice points. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
The following command definitions are derived from the Lammps manual found at http://lammps.sandia.gov/doc/Section_commands.html#cmd_5&lt;br /&gt;
* For the syntax below: I = atom type, value = mass&lt;br /&gt;
 mass I value&lt;br /&gt;
This code sets the mass of all atoms of type 1 to 1.0. &lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
* For the next piece of syntax, style = one of a selection of pre-programmed styles, args = arguments used by the chosen style. &lt;br /&gt;
 pair_style style args&lt;br /&gt;
This piece of code (pair_style) generally sets the formulas that describe pair wise interactions. Potentials between pairs of atoms are described only for pairs within a certain distance. Lennard Jones potential with no coulomb interactions is calculated using the text lj/cut. The global cut off for Lennard Jones interactions is set to 3.0 in this example. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
* For the final syntax, I,J = pair of atom types, args = coefficients for pairs of atom types.&lt;br /&gt;
 pair_coeff I J args&lt;br /&gt;
The use of an asterisk ensures that the coefficients are set for multiple atom type pairs. This specific piece of code dictates how the atoms interact with one another and sets the force field coefficients to 1.0 for all atom types. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field parameters for this simulation, considering you are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), we shall be using the velocity-Verlet integration algorithm&#039;&#039;&#039;. As discussed earlier, this algorithm considers both starting positions and initial velocities. &lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
Looking at the lines of code below. The second line (variable timestep) ensures that if the text &#039;timestep&#039; is encountered on any subsequent line, then the word &#039;timestep&#039; should be replaced by the given value. In the example below, this value is always replaced by 0.001. &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
This seems complex and begs the question, why not just simply write the following:&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
The code ensures that the timestep remains at 0.001 throughout any simulation runs. The reason that the more complex version is used when setting the timestep as a variable is that when the value of timestep is manually changed for a new simulation, the number of steps (which is directly affected by the timestep) will be adjusted automatically without the need for manual input. &lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
The following graphs are plots for the timestep 0.001 of energy, temperature and pressure against time. &lt;br /&gt;
[[File:0.001 energy vs time cf.png|none|thumb|1025x1025px|Graph of Energy vs Time for a Timestep of 0.001]]&lt;br /&gt;
[[File:0.001 press vs time cf.png|thumb|559x559px|Graph of Pressure vs Time for a Timestep of 0.001|left]]&lt;br /&gt;
[[File:0.001 temp vs time cf.png|thumb|579x579px|Graph of Temperature vs Time for a Timestep of 0.001|centre]]&lt;br /&gt;
. &lt;br /&gt;
&lt;br /&gt;
All three graphs prove that the simulation reached equilibrium, showing a plateau in y values. Using a zoomed in version of the energy vs time graph, it can be seen that the system equilibrates at a time of approximately 0.3. &lt;br /&gt;
[[File:0.001 energy vs time cf zoomed in for equilibrium time.png|none|thumb|858x858px|Zoomed in Version of 0.001 Timestep Energy vs Time graph]]The graph below shows a comparison between the energy vs time graphs for all the different timesteps used.  &lt;br /&gt;
&lt;br /&gt;
The timesteps of 0.01 and 0.0075 are both acceptable, equilibrating at an energy of approximately -3.182 and both with equal fluctuation about the average value. The timesteps of 0.0025 and 0.001 are both slightly more acceptable, as they fluctuate by a lesser amount around an average, equilibrium energy value of about -3.185.  &lt;br /&gt;
&lt;br /&gt;
0.01 is the largest acceptable timestep, but 0.0025 would produce the most accurate results and still is, itself, a reasonable timestep for the length of simulation run in this experiment.  &lt;br /&gt;
&lt;br /&gt;
The timestep of 0.015 is a particularly bad choice because it, in fact, does not reach equilibrium (as seen below). [[File:All timestep energy vs time graphs cf.png|none|thumb|757x757px|Graphs of Energy vs Time for All Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the choice of timestep.  0.0025 has the same total energy as the smallest timestep so is the best choice.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (Temperature and Pressure Control) ==&lt;br /&gt;
&lt;br /&gt;
=== Thermostats and Barostats ===&lt;br /&gt;
From statistical thermodynamics, we can write the following two equations:&lt;br /&gt;
[[File:Tt new equation cf.png|none|thumb|323x323px]]&lt;br /&gt;
&lt;br /&gt;
Generally, instantaneous temperature, T will fluctuate away from our target temperature. To ensure that temperature remains correct, i.e.:&lt;br /&gt;
[[File:Tt thing cf.png|none|thumb]]&lt;br /&gt;
each velocity value must be multiplied by gamma. We can then determine gamma by rearrangement.  &lt;br /&gt;
[[File:Finding gamme cfarnham.png|none|thumb|453x453px]]  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
The following syntax is used to code for an averaging command, which takes a number of values and computes their average over a given number of timesteps. &lt;br /&gt;
 fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&lt;br /&gt;
The example piece of code we will use is:&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
* &#039;&#039;&#039;Nevery&#039;&#039;&#039; = 100 = this instructs the computer to incorporate the input value at every 100th timestep into the average. &lt;br /&gt;
* &#039;&#039;&#039;Nrepeat&#039;&#039;&#039; = 1000 = this instructs the computer to use each input value 1000 times when calculating an average. &lt;br /&gt;
* &#039;&#039;&#039;Nfreq&#039;&#039;&#039; = 10000 = this instructs the computer to calculate an average at every 10000th timestep. &lt;br /&gt;
Values of temperature, etc will therefore be sampled at every 100th timestep. &lt;br /&gt;
&lt;br /&gt;
Total number of timesteps divided by 100, will be the number of measurements that contribute to the average. Each measurement is contributed 1000 times.&lt;br /&gt;
&lt;br /&gt;
Since the command reads &#039;&#039;&#039;&#039;run 100000&#039;, &#039;&#039;&#039;this number multiplied by the timestep 0.0025 will simulate 250 units of time. &lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
The graph below compares ideal gas behaviour to simulations ran at pressures of 2.5 and 3.0, with error bars included for both the x and y axis. The temperature used at each pressure were 1.5, 3.0, 4.5, 6.0 and 7.5 (inclusive of and above the critical temperature).[[File:Comparison of pressure for density vesus time and ideal gas predic cfarnham.png|none|thumb|980x980px|Graph of Density Against Temperature For Varying Pressures (Comparison also to ideal gas behaviour)]]The simulated densities at each pressure are lower than the ideal gas law predicts. The ideal gas law essentially states that all interactions between the particles in a system are negligible and therefore not considered.&amp;lt;ref&amp;gt;A. Kronig, (1856), &#039;&#039;Annalen der Physik und Chemie,&#039;&#039; &#039;&#039;&#039;99, &#039;&#039;&#039;315-322, doi: 10.1002/andp.18561751008&amp;lt;/ref&amp;gt; The densities are lower than in the ideal gas law prediction because the particles in the simulated liquid are interacting when they get too close and repelling each other via Lennard-Jones interactions. This causes the particles to spread out over a larger volume and therefore reduce the density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between ideal gas law predictions and the simulation increases with increased pressure (at all temperatures tested), as can be seen in the table below. This happens because at high pressure the particles occupy a smaller volume and are therefore packed more closely together. Lennard-Jones interactions become more significant for the simulation at higher pressure and are still being ignored by the ideal gas law prediction. Hence, at higher pressure the discrepancy becomes larger due to inter-molecular interactions reducing the density of the simulated system.   &lt;br /&gt;
[[File:Discrepancy pressure table cfarnham.png|none|thumb|374x374px|Table Showing Discrepancy Between Simulated Density and Ideal Gas Density for Varying Pressure]]  &lt;br /&gt;
&lt;br /&gt;
The discrepancy between ideal gas law predictions and the simulation decrease with temperature. This is because as the kinetic energy of the particles increases, their movement begins to overcome repulsive inter-molecular interactions in the simulation. The inter-molecular interactions become more and more negligible. The simulation therefore mirrors the ideal gas behaviour more closely at higher temperatures.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanations of the different trends.  Don&#039;t connect the simulation data points with a smooth line unless you are fitting the data points to a specific function.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities Using Statistical Physics ==&lt;br /&gt;
The graph below compares the effect of different densities (0.2 and 0.8) on the value of heat capacity/ volume for a range of temperatures (2.0, 2.2, 2.4, 2.6 and 2.8).  &lt;br /&gt;
[[File:Final heat capac farnham.png|none|thumb|731x731px|Graph of Heat Capacity/ Volume versus Temperature for Varying Densities]]The general trend for both plots is that Cv/V decreases with temperature. Specific heat capacity is defined as the heat energy needed to increase the temperature of a given mass of a certain substance by one degree. As more heat energy is provided, higher energy states are occupied. With higher energy states, the energy difference to the next, higher state becomes smaller and smaller. This means the promotion to the next energy state requires less energy and the substance as a whole will require less heat energy to raise in temperature by a given amount (i.e. the heat capacity has decreased). &lt;br /&gt;
&lt;br /&gt;
It can also be seen that the heat capacity of the substance increases with increased density. Increasing density increases the number of particles within the defined volume. This means that the same heat energy is shared across a larger number of particles and, hence the temperature is not raised as much as it would be at lower density with less molecules. This signifies that the heat capacity is larger for a higher density system, as the heat energy is spread over more particles. &lt;br /&gt;
&lt;br /&gt;
It should be noted that there is a &#039;bump&#039; in the trend for a density of 0.8. This could be for a number of reasons and requires further analysis to justify its presence. It can be speculated, however, that at a temperature of 2.4 this system contains particles with a particularly large density of states at a particular energy level. If this is the case, the heat capacity would increase producing a bump as seen above due to there being a larger requirement of heat energy to fill all energy states.   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Great explanation, as you say further work would be needed to confirm these conclusions.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Provided below is an example of the input scripts (for a density of 0.2 and temperature of 2.0). ===&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE SIMULATION BOX GEOMETRY ###    &lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY ENSEMBLE ###&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RECORD TRAJECTORY ###&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unfix nvt&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; MEASURE SYSTEM STATE, atoms will output atom number###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
&lt;br /&gt;
variable atoms equal atoms&lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
&lt;br /&gt;
variable energysquared equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
variable dens equal density&lt;br /&gt;
&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
&lt;br /&gt;
variable press equal press&lt;br /&gt;
&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energysquared&lt;br /&gt;
&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[7]&lt;br /&gt;
&lt;br /&gt;
variable aveenergysquared equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable heatcapacity equal (${atoms}*${atoms})*((${aveenergysquared}-(${aveenergy}*${aveenergy}))/(${avetemp}*${avetemp}))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
Below is a graph containing plots of radial distribution against distance r for solid, liquid and gas phases. It shows how density of particles varies as a function of radial distance, r, away from the central atom concerned. The following input conditions were used:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid: &#039;&#039;&#039;density = 1.2, temperature  = 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid: &#039;&#039;&#039;density = 0.8, temperature = 1.15&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas:&#039;&#039;&#039; density = 0.07, temperature = 1.15.&lt;br /&gt;
[[File:Cfarnham rdf graphs.png|none|thumb|887x887px|Radial Distribution Functions Against Distance, r, for Solid, Liquid and Gas Phases]]&#039;&#039;&#039;Similarities between phases: &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;At a small inter-molecular distance of r = 0 up until r = 0.9, all distribution functions produce a g(r) density value of 0. This is because the particles repel each other, so will not be found overlapping or in close proximity of one another.  &lt;br /&gt;
&lt;br /&gt;
All plots tend to 1 as infinity inter-nuclear distance r is approached, this value is the inherent density of the entire system. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: g(r) is normalised using the value of the bulk density.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Differences between phases:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The most noticeable difference between the phases is the trend in the number of peaks. Solid has the most peaks, then liquid and finally gas only has a single peak. The fact that the RDF for solid phase has many peaks over a long distance range shows that the system has long range order. A crystalline, solid structure possesses numerous particles at almost identical radial distances from the central particle. The first peak correlates to the particles nearest neighbours in the lattice and the second peaks to those the next distance, r, away and so on. The first peak is far sharper than the next peak at a larger distance. This is because the nearest neighbours will not vary much in their distance from the central particle, but this discrepancy in r between similar distanced particles will increase with distance from the central atom (hence widening the peaks). The solid also has sharper peaks than those of the gas and liquid phases, indicating the regularity of the solid structure and showing that the solid particles are trapped in a very small range of distance, r. &lt;br /&gt;
&lt;br /&gt;
For the liquid phase, the peaks are not present for the same reason. Liquids can be thought of as particles surrounded by primary and secondary spheres of more liquid particles. The peaks become smaller and broader as the successive spheres of liquid particles become more diffuse and less confined. The peaks are less sharp than those of the solid phase, as the liquid particles are free to move more than those of the solid, meaning they are found over a wider range or r values (the r values are less discretised).  &lt;br /&gt;
&lt;br /&gt;
The gas phase plot reaches a radial distribution of 1 at the lowest value of r, as it is already very low in density. Its lack of peaks are due to the gas phase lacking in any repetition of structure or order. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid RDF Plot:&#039;&#039;&#039;&lt;br /&gt;
[[File:Illustration cfarnham.png|none|thumb|Illustration of Lattice Spacings for A Face Centred Cubic Lattice]]&lt;br /&gt;
Referring to the illustration above, the first three peaks correspond to the following lattice sites:&lt;br /&gt;
* peak at r = 1.043 corresponds to site at distance b&lt;br /&gt;
* peak at r = 1.475 corresponds to site at distance c&lt;br /&gt;
* peak at r = 1.806 corresponds to site at farthest distance a.&lt;br /&gt;
The lattice spacings are:&lt;br /&gt;
* b: (1/2, 1/2, 0) = 1.043&lt;br /&gt;
* c: (0,1,0) = 1.475 &lt;br /&gt;
* a: (1/2, 1,1/2) = 1.806&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The lattice spacing is the distance between unit cells, in this case b, but you could have got a more accurate value for this by also expressing the distances to the first and third nearest neighbours in terms of the distance b, solving for b and then calculating an average value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The coordination number for each of the three peaks is as follows:&lt;br /&gt;
* b = 12&lt;br /&gt;
* c = 6&lt;br /&gt;
* a = 24&lt;br /&gt;
The integrals of the radial distribution function are included below:  &lt;br /&gt;
&lt;br /&gt;
[[File:Cfarnham integral rdf graphs.png|none|thumb|794x794px|Integrals of Radial Distribution Functions&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How did you calculate the number of nearest neighbours?  Show the integral of g(r) at small r to show the number of nearest neighbours responsible for each peak.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
Below are the plots of mean squared displacement versus timestep for solid, liquid and gas phase small systems and systems containing 1 million atoms. These plots provide information on the displacement of a particle in a given time and due to this offer a chance to gather information about the system as a whole. If the graph levels off, this suggests that the particle is trapped at a certain displacement. A curved graph (only up as the y values are squared) indicates an external force acting on the particles. A straight line that isn&#039;t of gradient 0 shows that the particle is only experiencing the effects of diffusion.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The curve at the beginning of these graphs indicates ballistic motion, when displacement is proportional to time, it is not due to an external force.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Gas msd pdf cf.png|none|thumb|602x602px|Graph of MSD versus timestep for Gaseous Systems possessing varying atom number]]&lt;br /&gt;
[[File:Liquid msd pdf cf.png|none|thumb|600x600px|Graph of MSD versus timestep for Liquid Systems possessing varying atom number]]&lt;br /&gt;
[[File:Solid pdf msd cf.png|none|thumb|604x604px|Graph of MSD versus timestep for Solid Systems possessing varying atom number]]These graphs are as expected. The simulations ran involved no applied force on the system or its particles. Therefore, as expected, a straight line graph is eventually produced for both the liquid and vapour plots. The liquid plot becomes linear faster than the gaseous plot. &lt;br /&gt;
&lt;br /&gt;
The solid plot levels off, as expected. This is because in the crystal lattice, the solid system and its particles are locked in position. There are, however, slight fluctuations around the final MSD value due to particle vibration in the lattice. The MSD values are smallest for the solid, larger for liquid and largest for the gas. The explanation for this is obvious, the solid is denser and its particles are more confined than the gas and the liquid. The displacement values for the particles in a gaseous system will be larger as the particles have more kinetic/thermal energy.                                                                &lt;br /&gt;
&lt;br /&gt;
Modelling the straight line section of each plot as follows and considering the gradient of the graphs to equal  the &#039;m&#039; part of the equation below allows the calculation of the diffusion coefficient, D. (all units were converted to real units).                                                                &lt;br /&gt;
[[File:C farnham gradient equations.png|none|thumb]]Below is a table of the D values calculated. The million atom simulations all match closely to the smaller simulations. The solid simulations agree to the closest values. The liquids have similar values and the gas simulations have the largest discrepancy between values. &lt;br /&gt;
[[File:D values cfarnham.png|none|thumb|Table of D values&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean by real units?  It would be good to show the lines of best fit that you used to calculate D on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A second way to calculate D involves an equation called the velocity autocorrelation function. It is evaluated in terms of a 1 dimensional harmonic oscillator. After some lengthy integrations it is found that:&lt;br /&gt;
[[File:Cfarnham 1st equations.png|none|thumb|714x714px]]&lt;br /&gt;
[[File:Cfarnham 2nd equarions.png|none|thumb|397x397px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The derivation can be simplified by using double angle formula to simplify the numerator and then identify this as an odd function to avoid having to perform the integration.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below are plots of VACF against timestep for solid and liquid simulations, as well as for the harmonic oscillator function. This graph shows the average velocity of all particles. Therefore the minima in VACFs represent when a particle has become to close to another particle and begins to be repelled. The repulsion continues until the velocity of the particle becomes 0 and it then changes direction and moves away from the particle it has just &#039;collided&#039; with. Eventually the simulations reach a point in time where all the velocities of all particles cancel out and the average velocity becomes 0. &lt;br /&gt;
&lt;br /&gt;
This is not the case for the harmonic oscillator as this function models the velocity of  a single particle. There are no particles to collide with, so the plot oscillates to infinity.  &lt;br /&gt;
&lt;br /&gt;
The liquid graph levels off faster than the solid graph. This is because there are more degrees of freedom for the particles in the liquid. Since their movement is less restricted they reach an equilibrium point faster, where the  &lt;br /&gt;
&lt;br /&gt;
velocities of each particle cancel out and the particles are more able to diffuse away from an interaction. &lt;br /&gt;
&lt;br /&gt;
The solid particles are more restricted and confined in their crystal lattice, meaning the atoms aren&#039;t as free to reach the point so quickly where their average velocities equal 0. &lt;br /&gt;
&lt;br /&gt;
[[File:Oscillator graph cfarnham.png|none|thumb|938x938px]]Using the trapezium rule, the area under the VACF plots for the solid, liquid and gas phase are predicted. This allows a prediction of D to also be calculated using the  following equation:&lt;br /&gt;
[[File:D equation for vacf charlie.png|none|thumb]]&lt;br /&gt;
{|&lt;br /&gt;
  |Integral&lt;br /&gt;
  |Trapezium Rule Prediction&lt;br /&gt;
  |D&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |Solid small system&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.374744354000011&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.12491&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |Solid 1 mil. Atoms&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.374744354000011&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.12491&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |liquid small system&lt;br /&gt;
  |123.737698410600000&lt;br /&gt;
  |41.2459&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |liquid 1 mil. Atoms&lt;br /&gt;
  |123.737698410600000&lt;br /&gt;
  |41.2459&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |gas small system&lt;br /&gt;
  |1299.701075000000000&lt;br /&gt;
  |433.2337&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |gas 1 mil. Atoms&lt;br /&gt;
  |490.153176500000000&lt;br /&gt;
  |163.3844&lt;br /&gt;
 |}&lt;br /&gt;
The only disparity in D value between the smaller simulation and that containing 1 million atoms, is for the gas phase. The trapezium rule is of course a large source of error as the area under the graph is approximated into discrete trapezoids. The expected running integrals we obtained.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How did you use that equation?  You should show the graphs of the running intergal.  Did the graphs level off at long times, why is this important?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
To conclude, molecular dynamics is a powerful tool for modelling chemical systems. It consists of useful tools such as radial distribution functions that can be used to accurately predict density of atoms at certain radial distances from a reference point.This investigation has only brushed the surface of liquid simulations and does not emphasize the significance of this computational method. From modelling protein interactions to assessing the affects of pressure on a super critical fluid, the applications of molecular dynamics are seemingly endless.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Cf1014&amp;diff=579601</id>
		<title>Talk:Cf1014</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Talk:Cf1014&amp;diff=579601"/>
		<updated>2017-01-31T14:48:24Z</updated>

		<summary type="html">&lt;p&gt;Jwc13: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&amp;#039;&amp;#039;&amp;#039;  By Charlie Farnham  == Introduction to Molecular Dynamics Simulation == Molecular dynamics is the study of the phy...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: General comments:.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By Charlie Farnham&lt;br /&gt;
&lt;br /&gt;
== Introduction to Molecular Dynamics Simulation ==&lt;br /&gt;
Molecular dynamics is the study of the physical movements of particles, using a computer simulation of a N-body simulation.&amp;lt;ref&amp;gt;Alder. B. J, Wainwright. T. E, (1959), &#039;&#039;J. Chem. Phys, &#039;&#039;&#039;&#039;&#039;31 &#039;&#039;&#039;(2), 459, doi: 10.1063/1.1730376&amp;lt;/ref&amp;gt; The method originated in the 1950s and 60s, pioneered by the physicists such as Metropolis and Fermi.&amp;lt;ref&amp;gt;Fermi. E, Pasta. J, Ulam. S, (1955), Los Alamos report LA, doi: ACC0041.pdf&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;N. Metropolis, A.W.Rosenbluth, A.H. Teller, E. Teller, (1953), &#039;&#039;J. Chem. Phys.&#039;&#039; &#039;&#039;&#039;21&#039;&#039;&#039;, 1087, doi: 10.1063/1.1699114. &amp;lt;/ref&amp;gt; While Metropolis and his team had managed to simulate a liquid of imaginary 2D spheres, Fermi was seeking to model forces between neighbouring atoms as a function of time. This type of simulation is extremely important to modern science, a good example being its use in predicting the behavior of biological and drug molecules when in contact with receptors and other bio-molecules.&amp;lt;ref&amp;gt;M. Karplus, R. Lavery, (2014), &#039;&#039;Computational Molecular Biophysics&#039;&#039;, &#039;&#039;&#039;54&#039;&#039;&#039;, 1042–1051, doi: 10.1002/ijch.201400074. &amp;lt;/ref&amp;gt; In this particular lab, use of the velocity-Verlet algorithm is employed to consider both starting positions and initial velocities of all atoms in a defined region. The significance of timestep values is explored and the Lennard-Jones interactions of pairs of atoms are considered to simulate and investigate real molecular dynamics. &lt;br /&gt;
&lt;br /&gt;
=== Harmonic Oscillator Demonstration ===&lt;br /&gt;
Initially, this section analyses the discrepancy between modelling a classic harmonic oscillator when using the classic solution and when using the velocity-Verlet algorithm solution. The position at time t for a classic harmonic oscillator is given by the following equation: &lt;br /&gt;
[[File:Pics of eqa.png|frameless|centre]][[File:Error graph for classic vs verlet algorithm with maxima trend.png|thumb|872x872px|Graph of absolute error between classic and Verlet algorithm solutions of position of a harmonic oscillator. |none]]Looking at the blue absolute error graph above, it can be seen that the error oscillates between 0 and an ever increasing maximum. This is explained by considering that the classical and velocity-verlet solutions are themselves sine waves, that at given times, regardless of their phase will intercept (resulting in a discrepancy of 0 at that given time). Observing the orange error maxima trend line it can be seen that total error increases as a function of time. This is because the errors with each sequential calculation are accumulative.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good understanding.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:X versus t classic graph.png|thumb|746x746px|Graph of position versus time for the displacement of a &lt;br /&gt;
harmonic oscillator using classical solution.|none]]&lt;br /&gt;
[[File:Total energy velocity verlet sltn graph.png|thumb|739x739px|Graph of Total Energy versus time for the velocity-Verlet algorithm|none]]           &lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;It is expected that total energy, consisting of kinetic and potential energy would be constant. A fluctuation in potential energy is coupled with a fluctuation in kinetic energy, resulting in a constant total energy (as one energy decreases it is exchanged into the other). As seen in the graph above, the model is not perfect and there is a negligible fluctuation in total energy. Time step is the number that controls how many calculations are made in a given time. The smaller the time step and therefore the more calculations made in a given time, the more realistic the model but the more difficult the set of calculations. 0.20 is the larger time step that resulted in a maximum error of 1.005% about the average, actual energy value. A time step of 0.19 gave a maximum error 0f 0.904% about the average energy. Clearly, a time step value between 0.19 and 0.20 is required to limit total error to 1.00%. It&#039;s important to monitor the total energy of a physical system when modelling its behaviour numerically because energy in the real system should be conserved and this should be simulated as accurately as possible in the model.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The Verlet algorithm is based on a Taylor expansion which is more accurate for a smaller timestep.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
.This is shown in the two graphs below. &lt;br /&gt;
&lt;br /&gt;
[[File:Time step 0.20 biggger than 1 perecent increaeerror graph for classic vs verlet algorithm with maxima trend.png|thumb|690x690px|Graph of Energy  versus time with time step 0.20|none]]&lt;br /&gt;
[[File:Time step 0.19 smaller than 1 perecent increaeerror graph for classic vs verlet algorithm with maxima trend.png|none|thumb|664x664px|Graph of Energy versus time with time step 0.19]]&lt;br /&gt;
&lt;br /&gt;
A time step of less than 0.19 would of course reduce the percentage error, but this would be an unnecessary level of accuracy.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
=== Atomic Forces ===&lt;br /&gt;
* For a single Lennard-Jones Interaction, when the potential energy equals 0, the separation (r) is found as follows: &lt;br /&gt;
[[File:Equations for r0 finding sigma.png|thumb|centre]]Since r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;or separation is larger than zero, we know that r&amp;lt;sub&amp;gt;0 &amp;lt;/sub&amp;gt;equals positive sigma.&lt;br /&gt;
* The force at this separation is found as follows:&lt;br /&gt;
[[File:Equations 2ddsd.png|none|thumb]]&lt;br /&gt;
* The equilibrium separation and well depth are found as follows:&lt;br /&gt;
&lt;br /&gt;
At equilibrium separation, force is set equal to zero.&lt;br /&gt;
[[File:Eqm sep and well depth sddd.png|none|thumb]]&lt;br /&gt;
[[File:Well depth init blud.png|none|thumb]]&lt;br /&gt;
* The following integrals are evaluated when &lt;br /&gt;
[[File:Integral conditions.png|none|thumb|157x157px]]This is probing to test at which separation, r, do we no longer consider an interaction between two atoms as significant. Of course, the force between two atoms decreases rapidly with r, and calculating this at infinite distance would be impossible to compute. (A cut off point must be decided, which is a compromise between simulating the real situation as closely as possible and allowing the computer to solve functions within a reasonable time). [[File:Answer to all integral evaluations bro.png|none|thumb|646x646px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: All maths correct and clearly laid out.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Periodic Boundary Conditions ===&lt;br /&gt;
* 1 mL of water equates to 0.056 moles. The total number of water molecules if therefore the product of the number of moles and Avogadro&#039;s constant: N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt; x 0.056 = &#039;&#039;&#039;3.34 x 10&amp;lt;sup&amp;gt;22 &amp;lt;/sup&amp;gt; molecules&#039;&#039;&#039;. &lt;br /&gt;
* 10000 molecules of water equate to 1.66 x 10&amp;lt;sup&amp;gt;-20 &amp;lt;/sup&amp;gt; moles. (10000/N&amp;lt;sub&amp;gt;A&amp;lt;/sub&amp;gt;). 1 mole of water occupies 18 mL, &#039;&#039;&#039;so 10000 molecules occupy 2.99 x 10&amp;lt;sup&amp;gt;-19 &amp;lt;/sup&amp;gt;mL&#039;&#039;&#039;.  &lt;br /&gt;
* Considering an atom at position (0.5,0.5,0.5) in a cubic simulation box running from (0,0,0) to (1,1,1). The atom moves along the vector (0.7,0.6,0.2) in a single time step. Without the boundary conditions, the atom would end up at position (1.2, 1.1, 0.7). The conditions mean that when an atom leaves the boundary, it is replaced by a replica atom entering from the opposite face of the boundary. After the periodic boundary conditions have been applied, &#039;&#039;&#039;it ends up at (0.2, 0.1, 0.7).&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
=== Reduced Units ===&lt;br /&gt;
To make values more manageable when using Lennard-Jones interactions, scaling factors are introduced, which convert real units into reduced units.    &lt;br /&gt;
[[File:Real units reduced units final complere.png|none|thumb|572x572px]]&lt;br /&gt;
== Equilibration ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct, but makes more sense to give r in nm.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Creating the Simulation Box ===&lt;br /&gt;
* Giving atoms random starting coordinates is likely to cause problems with simulations. This is because many atoms are being generated within a limited space, meaning the likelihood of two atoms overlapping or being very close to each other is high. Looking at the Lennard-Jones equation, we can see that when the inter-nuclear distance is below the equilibrium distance, the energy of the interaction between the two atoms becomes dramatically larger and hence the accuracy of the simulation becomes questionable. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: With high repulsive forces the simulation will crash unless a much smaller timestep is used.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* There is one lattice point per unit cell. Consider a unit cell with volume 1.07722&amp;lt;sup&amp;gt;3 &amp;lt;/sup&amp;gt; = 1.25. The number density specifies the number of lattice points per unit volume and is given by the equation  p = n/V .[[File:Number density eqn cfarnham.png|none|thumb|160x160px]]&lt;br /&gt;
*Considering a face centred cubic lattice with a lattice point number density of 1.2, the length of the side of the cubic unit cell can be calculated (n = 4 for a face centred cubic lattice).[[File:Volume equatin mate nit.png|none|thumb]]Using the original, simple cubic lattice, a simulated region of 10x10x10 unit cells contains 1000 atoms (as there is 1 atom/lattice point in each unit cell). If this were defined for the face centred cubic lattice with the same dimensions instead, &#039;&#039;&#039;it would be found that the region contained 4000 atoms&#039;&#039;&#039;, as each unit cell has 4 atoms/lattice points. &lt;br /&gt;
&lt;br /&gt;
=== Setting the Properties of the Atoms ===&lt;br /&gt;
The following command definitions are derived from the Lammps manual found at http://lammps.sandia.gov/doc/Section_commands.html#cmd_5&lt;br /&gt;
* For the syntax below: I = atom type, value = mass&lt;br /&gt;
 mass I value&lt;br /&gt;
This code sets the mass of all atoms of type 1 to 1.0. &lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
* For the next piece of syntax, style = one of a selection of pre-programmed styles, args = arguments used by the chosen style. &lt;br /&gt;
 pair_style style args&lt;br /&gt;
This piece of code (pair_style) generally sets the formulas that describe pair wise interactions. Potentials between pairs of atoms are described only for pairs within a certain distance. Lennard Jones potential with no coulomb interactions is calculated using the text lj/cut. The global cut off for Lennard Jones interactions is set to 3.0 in this example. &lt;br /&gt;
 pair_style lj/cut 3.0&lt;br /&gt;
* For the final syntax, I,J = pair of atom types, args = coefficients for pairs of atom types.&lt;br /&gt;
 pair_coeff I J args&lt;br /&gt;
The use of an asterisk ensures that the coefficients are set for multiple atom type pairs. This specific piece of code dictates how the atoms interact with one another and sets the force field coefficients to 1.0 for all atom types. &lt;br /&gt;
 pair_coeff * * 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What are the force field parameters for this simulation, considering you are using a Lennard-Jones potential?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Given that we are specifying x&amp;lt;sub&amp;gt;i &amp;lt;/sub&amp;gt;(0) and v&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; (0), we shall be using the velocity-Verlet integration algorithm&#039;&#039;&#039;. As discussed earlier, this algorithm considers both starting positions and initial velocities. &lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
Looking at the lines of code below. The second line (variable timestep) ensures that if the text &#039;timestep&#039; is encountered on any subsequent line, then the word &#039;timestep&#039; should be replaced by the given value. In the example below, this value is always replaced by 0.001. &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
 variable timestep equal 0.001&lt;br /&gt;
 variable n_steps equal floor(100/${timestep})&lt;br /&gt;
 variable n_steps equal floor(100/0.001)&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### RUN SIMULATION ###&lt;br /&gt;
 run ${n_steps}&lt;br /&gt;
 run 100000&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
This seems complex and begs the question, why not just simply write the following:&lt;br /&gt;
 timestep 0.001&lt;br /&gt;
 run 100000&lt;br /&gt;
The code ensures that the timestep remains at 0.001 throughout any simulation runs. The reason that the more complex version is used when setting the timestep as a variable is that when the value of timestep is manually changed for a new simulation, the number of steps (which is directly affected by the timestep) will be adjusted automatically without the need for manual input. &lt;br /&gt;
&lt;br /&gt;
=== Checking Equilibration ===&lt;br /&gt;
The following graphs are plots for the timestep 0.001 of energy, temperature and pressure against time. &lt;br /&gt;
[[File:0.001 energy vs time cf.png|none|thumb|1025x1025px|Graph of Energy vs Time for a Timestep of 0.001]]&lt;br /&gt;
[[File:0.001 press vs time cf.png|thumb|559x559px|Graph of Pressure vs Time for a Timestep of 0.001|left]]&lt;br /&gt;
[[File:0.001 temp vs time cf.png|thumb|579x579px|Graph of Temperature vs Time for a Timestep of 0.001|centre]]&lt;br /&gt;
. &lt;br /&gt;
&lt;br /&gt;
All three graphs prove that the simulation reached equilibrium, showing a plateau in y values. Using a zoomed in version of the energy vs time graph, it can be seen that the system equilibrates at a time of approximately 0.3. &lt;br /&gt;
[[File:0.001 energy vs time cf zoomed in for equilibrium time.png|none|thumb|858x858px|Zoomed in Version of 0.001 Timestep Energy vs Time graph]]The graph below shows a comparison between the energy vs time graphs for all the different timesteps used.  &lt;br /&gt;
&lt;br /&gt;
The timesteps of 0.01 and 0.0075 are both acceptable, equilibrating at an energy of approximately -3.182 and both with equal fluctuation about the average value. The timesteps of 0.0025 and 0.001 are both slightly more acceptable, as they fluctuate by a lesser amount around an average, equilibrium energy value of about -3.185.  &lt;br /&gt;
&lt;br /&gt;
0.01 is the largest acceptable timestep, but 0.0025 would produce the most accurate results and still is, itself, a reasonable timestep for the length of simulation run in this experiment.  &lt;br /&gt;
&lt;br /&gt;
The timestep of 0.015 is a particularly bad choice because it, in fact, does not reach equilibrium (as seen below). [[File:All timestep energy vs time graphs cf.png|none|thumb|757x757px|Graphs of Energy vs Time for All Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The average total energy should not depend on the choice of timestep.  0.0025 has the same total energy as the smallest timestep so is the best choice.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Running Simulations Under Specific Conditions (Temperature and Pressure Control) ==&lt;br /&gt;
&lt;br /&gt;
=== Thermostats and Barostats ===&lt;br /&gt;
From statistical thermodynamics, we can write the following two equations:&lt;br /&gt;
[[File:Tt new equation cf.png|none|thumb|323x323px]]&lt;br /&gt;
&lt;br /&gt;
Generally, instantaneous temperature, T will fluctuate away from our target temperature. To ensure that temperature remains correct, i.e.:&lt;br /&gt;
[[File:Tt thing cf.png|none|thumb]]&lt;br /&gt;
each velocity value must be multiplied by gamma. We can then determine gamma by rearrangement.  &lt;br /&gt;
[[File:Finding gamme cfarnham.png|none|thumb|453x453px]]  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Correct.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Examining the Input Script ===&lt;br /&gt;
The following syntax is used to code for an averaging command, which takes a number of values and computes their average over a given number of timesteps. &lt;br /&gt;
 fix ID group-ID ave/time Nevery Nrepeat Nfreq value1 value2 ... keyword args ...&lt;br /&gt;
The example piece of code we will use is:&lt;br /&gt;
 fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2&lt;br /&gt;
* &#039;&#039;&#039;Nevery&#039;&#039;&#039; = 100 = this instructs the computer to incorporate the input value at every 100th timestep into the average. &lt;br /&gt;
* &#039;&#039;&#039;Nrepeat&#039;&#039;&#039; = 1000 = this instructs the computer to use each input value 1000 times when calculating an average. &lt;br /&gt;
* &#039;&#039;&#039;Nfreq&#039;&#039;&#039; = 10000 = this instructs the computer to calculate an average at every 10000th timestep. &lt;br /&gt;
Values of temperature, etc will therefore be sampled at every 100th timestep. &lt;br /&gt;
&lt;br /&gt;
Total number of timesteps divided by 100, will be the number of measurements that contribute to the average. Each measurement is contributed 1000 times.&lt;br /&gt;
&lt;br /&gt;
Since the command reads &#039;&#039;&#039;&#039;run 100000&#039;, &#039;&#039;&#039;this number multiplied by the timestep 0.0025 will simulate 250 units of time. &lt;br /&gt;
&lt;br /&gt;
=== Plotting the Equations of State ===&lt;br /&gt;
The graph below compares ideal gas behaviour to simulations ran at pressures of 2.5 and 3.0, with error bars included for both the x and y axis. The temperature used at each pressure were 1.5, 3.0, 4.5, 6.0 and 7.5 (inclusive of and above the critical temperature).[[File:Comparison of pressure for density vesus time and ideal gas predic cfarnham.png|none|thumb|980x980px|Graph of Density Against Temperature For Varying Pressures (Comparison also to ideal gas behaviour)]]The simulated densities at each pressure are lower than the ideal gas law predicts. The ideal gas law essentially states that all interactions between the particles in a system are negligible and therefore not considered.&amp;lt;ref&amp;gt;A. Kronig, (1856), &#039;&#039;Annalen der Physik und Chemie,&#039;&#039; &#039;&#039;&#039;99, &#039;&#039;&#039;315-322, doi: 10.1002/andp.18561751008&amp;lt;/ref&amp;gt; The densities are lower than in the ideal gas law prediction because the particles in the simulated liquid are interacting when they get too close and repelling each other via Lennard-Jones interactions. This causes the particles to spread out over a larger volume and therefore reduce the density. &lt;br /&gt;
&lt;br /&gt;
The discrepancy between ideal gas law predictions and the simulation increases with increased pressure (at all temperatures tested), as can be seen in the table below. This happens because at high pressure the particles occupy a smaller volume and are therefore packed more closely together. Lennard-Jones interactions become more significant for the simulation at higher pressure and are still being ignored by the ideal gas law prediction. Hence, at higher pressure the discrepancy becomes larger due to inter-molecular interactions reducing the density of the simulated system.   &lt;br /&gt;
[[File:Discrepancy pressure table cfarnham.png|none|thumb|374x374px|Table Showing Discrepancy Between Simulated Density and Ideal Gas Density for Varying Pressure]]  &lt;br /&gt;
&lt;br /&gt;
The discrepancy between ideal gas law predictions and the simulation decrease with temperature. This is because as the kinetic energy of the particles increases, their movement begins to overcome repulsive inter-molecular interactions in the simulation. The inter-molecular interactions become more and more negligible. The simulation therefore mirrors the ideal gas behaviour more closely at higher temperatures.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Good explanations of the different trends.  Don&#039;t connect the simulation data points with a smooth line unless you are fitting the data points to a specific function.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Calculating Heat Capacities Using Statistical Physics ==&lt;br /&gt;
The graph below compares the effect of different densities (0.2 and 0.8) on the value of heat capacity/ volume for a range of temperatures (2.0, 2.2, 2.4, 2.6 and 2.8).  &lt;br /&gt;
[[File:Final heat capac farnham.png|none|thumb|731x731px|Graph of Heat Capacity/ Volume versus Temperature for Varying Densities]]The general trend for both plots is that Cv/V decreases with temperature. Specific heat capacity is defined as the heat energy needed to increase the temperature of a given mass of a certain substance by one degree. As more heat energy is provided, higher energy states are occupied. With higher energy states, the energy difference to the next, higher state becomes smaller and smaller. This means the promotion to the next energy state requires less energy and the substance as a whole will require less heat energy to raise in temperature by a given amount (i.e. the heat capacity has decreased). &lt;br /&gt;
&lt;br /&gt;
It can also be seen that the heat capacity of the substance increases with increased density. Increasing density increases the number of particles within the defined volume. This means that the same heat energy is shared across a larger number of particles and, hence the temperature is not raised as much as it would be at lower density with less molecules. This signifies that the heat capacity is larger for a higher density system, as the heat energy is spread over more particles. &lt;br /&gt;
&lt;br /&gt;
It should be noted that there is a &#039;bump&#039; in the trend for a density of 0.8. This could be for a number of reasons and requires further analysis to justify its presence. It can be speculated, however, that at a temperature of 2.4 this system contains particles with a particularly large density of states at a particular energy level. If this is the case, the heat capacity would increase producing a bump as seen above due to there being a larger requirement of heat energy to fill all energy states.   &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: Great explanation, as you say further work would be needed to confirm these conclusions.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Provided below is an example of the input scripts (for a density of 0.2 and temperature of 2.0). ===&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE SIMULATION BOX GEOMETRY ###    &lt;br /&gt;
&lt;br /&gt;
variable d equal 0.2&lt;br /&gt;
&lt;br /&gt;
lattice sc ${d}&lt;br /&gt;
&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
&lt;br /&gt;
create_box 1 box&lt;br /&gt;
&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY ENSEMBLE ###&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RECORD TRAJECTORY ###&lt;br /&gt;
&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
unfix nve&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
&lt;br /&gt;
run 10000&lt;br /&gt;
&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unfix nvt&lt;br /&gt;
&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; MEASURE SYSTEM STATE, atoms will output atom number###&lt;br /&gt;
&lt;br /&gt;
thermo_style custom step etotal temp press density atoms&lt;br /&gt;
&lt;br /&gt;
variable atoms equal atoms&lt;br /&gt;
&lt;br /&gt;
variable energy equal etotal&lt;br /&gt;
&lt;br /&gt;
variable energysquared equal etotal*etotal&lt;br /&gt;
&lt;br /&gt;
variable dens equal density&lt;br /&gt;
&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
&lt;br /&gt;
variable press equal press&lt;br /&gt;
&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energysquared&lt;br /&gt;
&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
&lt;br /&gt;
variable aveenergy equal f_aves[7]&lt;br /&gt;
&lt;br /&gt;
variable aveenergysquared equal f_aves[8]&lt;br /&gt;
&lt;br /&gt;
variable heatcapacity equal (${atoms}*${atoms})*((${aveenergysquared}-(${aveenergy}*${aveenergy}))/(${avetemp}*${avetemp}))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Heat Capacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Structural Properties and the Radial Distribution Function ==&lt;br /&gt;
Below is a graph containing plots of radial distribution against distance r for solid, liquid and gas phases. It shows how density of particles varies as a function of radial distance, r, away from the central atom concerned. The following input conditions were used:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid: &#039;&#039;&#039;density = 1.2, temperature  = 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid: &#039;&#039;&#039;density = 0.8, temperature = 1.15&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas:&#039;&#039;&#039; density = 0.07, temperature = 1.15.&lt;br /&gt;
[[File:Cfarnham rdf graphs.png|none|thumb|887x887px|Radial Distribution Functions Against Distance, r, for Solid, Liquid and Gas Phases]]&#039;&#039;&#039;Similarities between phases: &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;At a small inter-molecular distance of r = 0 up until r = 0.9, all distribution functions produce a g(r) density value of 0. This is because the particles repel each other, so will not be found overlapping or in close proximity of one another.  &lt;br /&gt;
&lt;br /&gt;
All plots tend to 1 as infinity inter-nuclear distance r is approached, this value is the inherent density of the entire system. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: g(r) is normalised using the value of the bulk density.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Differences between phases:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The most noticeable difference between the phases is the trend in the number of peaks. Solid has the most peaks, then liquid and finally gas only has a single peak. The fact that the RDF for solid phase has many peaks over a long distance range shows that the system has long range order. A crystalline, solid structure possesses numerous particles at almost identical radial distances from the central particle. The first peak correlates to the particles nearest neighbours in the lattice and the second peaks to those the next distance, r, away and so on. The first peak is far sharper than the next peak at a larger distance. This is because the nearest neighbours will not vary much in their distance from the central particle, but this discrepancy in r between similar distanced particles will increase with distance from the central atom (hence widening the peaks). The solid also has sharper peaks than those of the gas and liquid phases, indicating the regularity of the solid structure and showing that the solid particles are trapped in a very small range of distance, r. &lt;br /&gt;
&lt;br /&gt;
For the liquid phase, the peaks are not present for the same reason. Liquids can be thought of as particles surrounded by primary and secondary spheres of more liquid particles. The peaks become smaller and broader as the successive spheres of liquid particles become more diffuse and less confined. The peaks are less sharp than those of the solid phase, as the liquid particles are free to move more than those of the solid, meaning they are found over a wider range or r values (the r values are less discretised).  &lt;br /&gt;
&lt;br /&gt;
The gas phase plot reaches a radial distribution of 1 at the lowest value of r, as it is already very low in density. Its lack of peaks are due to the gas phase lacking in any repetition of structure or order. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid RDF Plot:&#039;&#039;&#039;&lt;br /&gt;
[[File:Illustration cfarnham.png|none|thumb|Illustration of Lattice Spacings for A Face Centred Cubic Lattice]]&lt;br /&gt;
Referring to the illustration above, the first three peaks correspond to the following lattice sites:&lt;br /&gt;
* peak at r = 1.043 corresponds to site at distance b&lt;br /&gt;
* peak at r = 1.475 corresponds to site at distance c&lt;br /&gt;
* peak at r = 1.806 corresponds to site at farthest distance a.&lt;br /&gt;
The lattice spacings are:&lt;br /&gt;
* b: (1/2, 1/2, 0) = 1.043&lt;br /&gt;
* c: (0,1,0) = 1.475 &lt;br /&gt;
* a: (1/2, 1,1/2) = 1.806&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The lattice spacing is the distance between unit cells, in this case b, but you could have got a more accurate value for this by also expressing the distances to the first and third nearest neighbours in terms of the distance b, solving for b and then calculating an average value.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The coordination number for each of the three peaks is as follows:&lt;br /&gt;
* b = 12&lt;br /&gt;
* c = 6&lt;br /&gt;
* a = 24&lt;br /&gt;
The integrals of the radial distribution function are included below:  &lt;br /&gt;
&lt;br /&gt;
[[File:Cfarnham integral rdf graphs.png|none|thumb|794x794px|Integrals of Radial Distribution Functions&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
== Dynamical Properties and the Diffusion Coefficient ==&lt;br /&gt;
Below are the plots of mean squared displacement versus timestep for solid, liquid and gas phase small systems and systems containing 1 million atoms. These plots provide information on the displacement of a particle in a given time and due to this offer a chance to gather information about the system as a whole. If the graph levels off, this suggests that the particle is trapped at a certain displacement. A curved graph (only up as the y values are squared) indicates an external force acting on the particles. A straight line that isn&#039;t of gradient 0 shows that the particle is only experiencing the effects of diffusion.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The curve at the beginning of these graphs indicates ballistic motion, when displacement is proportional to time, it is not due to an external force.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Gas msd pdf cf.png|none|thumb|602x602px|Graph of MSD versus timestep for Gaseous Systems possessing varying atom number]]&lt;br /&gt;
[[File:Liquid msd pdf cf.png|none|thumb|600x600px|Graph of MSD versus timestep for Liquid Systems possessing varying atom number]]&lt;br /&gt;
[[File:Solid pdf msd cf.png|none|thumb|604x604px|Graph of MSD versus timestep for Solid Systems possessing varying atom number]]These graphs are as expected. The simulations ran involved no applied force on the system or its particles. Therefore, as expected, a straight line graph is eventually produced for both the liquid and vapour plots. The liquid plot becomes linear faster than the gaseous plot. &lt;br /&gt;
&lt;br /&gt;
The solid plot levels off, as expected. This is because in the crystal lattice, the solid system and its particles are locked in position. There are, however, slight fluctuations around the final MSD value due to particle vibration in the lattice. The MSD values are smallest for the solid, larger for liquid and largest for the gas. The explanation for this is obvious, the solid is denser and its particles are more confined than the gas and the liquid. The displacement values for the particles in a gaseous system will be larger as the particles have more kinetic/thermal energy.                                                                &lt;br /&gt;
&lt;br /&gt;
Modelling the straight line section of each plot as follows and considering the gradient of the graphs to equal  the &#039;m&#039; part of the equation below allows the calculation of the diffusion coefficient, D. (all units were converted to real units).                                                                &lt;br /&gt;
[[File:C farnham gradient equations.png|none|thumb]]Below is a table of the D values calculated. The million atom simulations all match closely to the smaller simulations. The solid simulations agree to the closest values. The liquids have similar values and the gas simulations have the largest discrepancy between values. &lt;br /&gt;
[[File:D values cfarnham.png|none|thumb|Table of D values&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: What do you mean by real units?  It would be good to show the lines of best fit that you used to calculate D on the graphs.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A second way to calculate D involves an equation called the velocity autocorrelation function. It is evaluated in terms of a 1 dimensional harmonic oscillator. After some lengthy integrations it is found that:&lt;br /&gt;
[[File:Cfarnham 1st equations.png|none|thumb|714x714px]]&lt;br /&gt;
[[File:Cfarnham 2nd equarions.png|none|thumb|397x397px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: The derivation can be simplified by using double angle formula to simplify the numerator and then identify this as an odd function to avoid having to perform the integration.&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Below are plots of VACF against timestep for solid and liquid simulations, as well as for the harmonic oscillator function. This graph shows the average velocity of all particles. Therefore the minima in VACFs represent when a particle has become to close to another particle and begins to be repelled. The repulsion continues until the velocity of the particle becomes 0 and it then changes direction and moves away from the particle it has just &#039;collided&#039; with. Eventually the simulations reach a point in time where all the velocities of all particles cancel out and the average velocity becomes 0. &lt;br /&gt;
&lt;br /&gt;
This is not the case for the harmonic oscillator as this function models the velocity of  a single particle. There are no particles to collide with, so the plot oscillates to infinity.  &lt;br /&gt;
&lt;br /&gt;
The liquid graph levels off faster than the solid graph. This is because there are more degrees of freedom for the particles in the liquid. Since their movement is less restricted they reach an equilibrium point faster, where the  &lt;br /&gt;
&lt;br /&gt;
velocities of each particle cancel out and the particles are more able to diffuse away from an interaction. &lt;br /&gt;
&lt;br /&gt;
The solid particles are more restricted and confined in their crystal lattice, meaning the atoms aren&#039;t as free to reach the point so quickly where their average velocities equal 0. &lt;br /&gt;
&lt;br /&gt;
[[File:Oscillator graph cfarnham.png|none|thumb|938x938px]]Using the trapezium rule, the area under the VACF plots for the solid, liquid and gas phase are predicted. This allows a prediction of D to also be calculated using the  following equation:&lt;br /&gt;
[[File:D equation for vacf charlie.png|none|thumb]]&lt;br /&gt;
{|&lt;br /&gt;
  |Integral&lt;br /&gt;
  |Trapezium Rule Prediction&lt;br /&gt;
  |D&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |Solid small system&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.374744354000011&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.12491&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |Solid 1 mil. Atoms&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.374744354000011&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  |&amp;lt;nowiki&amp;gt;-0.12491&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |liquid small system&lt;br /&gt;
  |123.737698410600000&lt;br /&gt;
  |41.2459&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |liquid 1 mil. Atoms&lt;br /&gt;
  |123.737698410600000&lt;br /&gt;
  |41.2459&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |gas small system&lt;br /&gt;
  |1299.701075000000000&lt;br /&gt;
  |433.2337&lt;br /&gt;
 &lt;br /&gt;
 |-&lt;br /&gt;
  |gas 1 mil. Atoms&lt;br /&gt;
  |490.153176500000000&lt;br /&gt;
  |163.3844&lt;br /&gt;
 |}&lt;br /&gt;
The only disparity in D value between the smaller simulation and that containing 1 million atoms, is for the gas phase. The trapezium rule is of course a large source of error as the area under the graph is approximated into discrete trapezoids. The expected running integrals we obtained.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;JC: How did you use that equation?  You should show the graphs of the running intergal.  Did the graphs level off at long times, why is this important?&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
To conclude, molecular dynamics is a powerful tool for modelling chemical systems. It consists of useful tools such as radial distribution functions that can be used to accurately predict density of atoms at certain radial distances from a reference point.This investigation has only brushed the surface of liquid simulations and does not emphasize the significance of this computational method. From modelling protein interactions to assessing the affects of pressure on a super critical fluid, the applications of molecular dynamics are seemingly endless.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;/div&gt;</summary>
		<author><name>Jwc13</name></author>
	</entry>
</feed>