<?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=Mcd13</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=Mcd13"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Mcd13"/>
	<updated>2026-04-22T00:06:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518472</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518472"/>
		<updated>2015-12-04T19:52:41Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13 VACF plots for LJ solid and liquid simulations and the HO]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid(figures 14-15)&#039;&#039;&#039;[[File:solid3200.png|200px|thumb|left|figure 14 VACF and running integral vs time for 3200 atom solid simulation]]&lt;br /&gt;
 &amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
[[File:solidM.png|200px|thumb|left|figure 15 VACF and running integral vs time for 1000000 atom solid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid(figures 16-17)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|200px|thumb|left|figure 16 VACF and running integral vs time for 8000 atom liquid simulation]&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
 [[File:liquidM.png|200px|thumb|left|figure 17 VACF and running integral vs time for 1000000 atom liquid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas(figures 18-19)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|200px|thumb|left|figure 18 VACF and running integral vs time for 8000 atom gas simulation]]&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
 [[File:gasM.png|200px|thumb|left|figure 19 VACF and running integral vs time for 1000000 atom gas simulation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method.&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;
References:&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518471</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518471"/>
		<updated>2015-12-04T19:51:43Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Task 19: Integrating using the trapezium rule to get D */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13 VACF plots for LJ solid and liquid simulations and the HO]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid(figures 14-15)&#039;&#039;&#039;[[File:solid3200.png|200px|thumb|left|figure 14 VACF and running integral vs time for 3200 atom solid simulation]]&lt;br /&gt;
 &amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
[[File:solidM.png|200px|thumb|left|figure 15 VACF and running integral vs time for 1000000 atom solid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid(figures 16-17)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|200px|thumb|left|figure 16 VACF and running integral vs time for 8000 atom liquid simulation]&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
 [[File:liquidM.png|200px|thumb|left|figure 17 VACF and running integral vs time for 1000000 atom liquid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas(figures 18-19)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|200px|thumb|left|figure 18 VACF and running integral vs time for 8000 atom gas simulation]]&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
 [[File:gasM.png|200px|thumb|left|figure 19 VACF and running integral vs time for 1000000 atom gas simulation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518469</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518469"/>
		<updated>2015-12-04T19:50:41Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13 VACF plots for LJ solid and liquid simulations and the HO]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid(figures 14-15)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:solid3200.png|200px|thumb|left|figure 14 VACF and running integral vs time for 3200 atom solid simulation]] &amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
[[File:solidM.png|200px|thumb|left|figure 15 VACF and running integral vs time for 1000000 atom solid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid(figures 16-17)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|200px|thumb|left|figure 16 VACF and running integral vs time for 8000 atom liquid simulation]&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
 [[File:liquidM.png|200px|thumb|left|figure 17 VACF and running integral vs time for 1000000 atom liquid simulation]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas(figures 18-19)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|200px|thumb|left|figure 18 VACF and running integral vs time for 8000 atom gas simulation]]&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
 [[File:gasM.png|200px|thumb|left|figure 19 VACF and running integral vs time for 1000000 atom gas simulation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518461</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518461"/>
		<updated>2015-12-04T19:47:40Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid(figures 14-15)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:solid3200.png|200px|thumb|left|figure 14]] &amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
[[File:solidM.png|200px|thumb|left|figure 15]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid(figures 16-17)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|200px|thumb|left|figure 16]]&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
 [[File:liquidM.png|200px|thumb|left|figure 17]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas(figures 18-19)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|200px|thumb|left|figure 18]]&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
 [[File:gasM.png|200px|thumb|left|figure 19]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518459</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518459"/>
		<updated>2015-12-04T19:46:30Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Task 19: Integrating using the trapezium rule to get D */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid(figures 14-15)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:solid3200.png|200px|thumb|left|figure 14]] [[File:solidM.png|200px|thumb|left|figure 15]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid(figures 16-17)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|200px|thumb|left|figure 16]] [[File:liquidM.png|800px|thumb|left|figure 17]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas(figures 18-19)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|200px|thumb|left|figure 18]] [[File:gasM.png|800px|thumb|left|figure 19]]&lt;br /&gt;
&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518458</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518458"/>
		<updated>2015-12-04T19:44:09Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{3}\int\limits_0^{\infty}d\tau&amp;lt;v(0)xv(\tau)&amp;gt; = \frac{\frac{V_n + V_{n+1}}{2} x (\Tau_{n+1}-\Tau_{n}) + r_{n-1}}{3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first part of this equation is the relationship between &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, the diffusion coefficient and the VACF. The second part is the equation used in excel to calculate the running integral. Where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the velocity, &amp;lt;math&amp;gt;\Tau&amp;lt;/math&amp;gt; is the timestep and &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the last integral calculated. The last value of the running integral was divided by 3 to give &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solid&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:solid3200.png|800px|thumb|centre|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Liquid&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gas&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;br /&gt;
&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation gives a more accurate result, therefore the million atom simulation and the smaller one do have a small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518453</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518453"/>
		<updated>2015-12-04T19:30:36Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
====Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time====&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&lt;br /&gt;
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;
&lt;br /&gt;
====Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position====&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
[[File:solid3200.png|800px|thumb|centre|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 1.8 x 10^{-4} m s^{-2}&amp;lt;/math&amp;gt; for the small solid simulation and &amp;lt;math&amp;gt; 4.55 x 10^{-5} m s^{-2}&amp;lt;/math&amp;gt; for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
[[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] &lt;br /&gt;
&amp;lt;math&amp;gt;D = 9.8 x 10^{-2} m s^{-2}&amp;lt;/math&amp;gt;  for the small liquid simulation and &amp;lt;math&amp;gt; 9.0 x 10^{-2} s m^{-2}&amp;lt;/math&amp;gt; for the million atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
[[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;br /&gt;
&amp;lt;math&amp;gt;D = 2.34 m s^{-2}&amp;lt;/math&amp;gt; for the small gas simulation and &amp;lt;math&amp;gt;3.27 m s^{-2} &amp;lt;/math&amp;gt;  for the million atom simulation. &lt;br /&gt;
&lt;br /&gt;
The diffusion coefficients are as would be expected for the respective states. An atom in a tight lattice is not free to diffuse and is locked in position, this is reflected in its very small value. The liquid has a more important diffusion coefficient since the atoms are free to move, however they do experience more impeding forces such as drag while passing other moving atoms. Finally the gas is also a reasonable estimation, it is much greater than the solid and liquid since the atoms are a lot more disperse and so move very quickly and encountering relatively few restrictive forces.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Sources of error in the estimates&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A larger number of atoms included in the simulation will give a more accurate result, the million atom simulation and the smaller one do have small difference in values which can be accounted for by this. Another important source of error comes from the running integral calculation, each new area will have the previous area added to it, this results in a build-up of errors. The two solid diffusion coefficients calculated from the running integral are an order larger than the coefficient calculated using the mean squared displacement method. &lt;br /&gt;
&lt;br /&gt;
References: {{http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/}}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518448</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518448"/>
		<updated>2015-12-04T19:24:15Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Furthermore the solid&#039;s first peak is considerably larger than the other phases, the probability is much greater due to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances &amp;lt;math&amp;gt;r_a&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;r_b&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;r_c&amp;lt;/math&amp;gt;(where &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep.&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation above) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behavior. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficient, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the Lennard-Jones(LJ) solid, liquid and harmonic osillator(HO) VACFs against position&lt;br /&gt;
&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid VACF reaches its minima much quicker than the liquid; the atoms in the solid are much closer together and so have more surrounding atoms, it therefore takes less time for atoms to collide.  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling about with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behaviour because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;&amp;lt;ref&amp;gt;http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html/&amp;lt;/ref&amp;gt; by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The LJ VACFs become decorrelated after colliding with other atoms, after collision the subsequent velocities no longer depend on the initial velocity. The Harmonic Oscillator’s VACF is fully correlated with the initial velocity. It behaves periodically, always returning through the same points after a certain amount of time. The differences seen between these plots are rooted in the essence of the representations. The HO models two sphere’s connected by a spring, the spring may expand and contract with perfect elasticity. In addition to this there are no external forces which could cause the velocities to decorelate. The LJ representions are effected by surrounding atoms, the velocities loose their correlation after a collision. &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
References: {{reflist}}&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518445</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518445"/>
		<updated>2015-12-04T19:09:29Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated [https://wiki.ch.ic.ac.uk/wiki/index.php?title=File:CvExp.png here], the energy levels are closer together at higher temperatures e.g.&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt; and further apart at lower temperatures e.g.&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;. When a heat increment, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt;, is introduced into the two systems we see that it has a different effect in both. At &amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; will give a greater temperature increase than &amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V=\frac{dq}{dT}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure, since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep &lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation which is where the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms. At the minima the hanges direction after colliding fully with other atoms &lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518425</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518425"/>
		<updated>2015-12-04T18:57:02Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
[[File:0.001tpe.png|400px|thumb|right|&#039;&#039;Figure 5. Temperature, pressure and total energy against time for the simulation using a timestep of 0.001 &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V was calculated with the following equation;&lt;br /&gt;
&amp;lt;math&amp;gt; C_v = N^2\frac{&amp;lt;E^2&amp;gt;-&amp;lt;E&amp;gt;^2}{K_BT^2} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The effect on heat capacity at different temperatures and pressures&lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated here, the energy levels are closer together at higher temperatures(&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;) and further apart at lower temperatures(&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;). When a heat increment &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; is introduced into the two systems we see that it has a different effect in both. At T2 the dq will give a greater temperature increase than T1, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
[[Media:Cvexp.ogg]] &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep &lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation which is where the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms. At the minima the hanges direction after colliding fully with other atoms &lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:0.001tpe.png&amp;diff=518417</id>
		<title>File:0.001tpe.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:0.001tpe.png&amp;diff=518417"/>
		<updated>2015-12-04T18:45:57Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518397</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518397"/>
		<updated>2015-12-04T18:29:24Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using &amp;lt;math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&amp;lt;/math&amp;gt; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H_2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box &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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; \epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J mol^{-1} = 9.98x10^{-1} KJ mol^-1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, therefore;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points, therfore;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated here, the energy levels are closer together at higher temperatures(&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;) and further apart at lower temperatures(&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;). When a heat increment &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; is introduced into the two systems we see that it has a different effect in both. At T2 the dq will give a greater temperature increase than T1, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
[[Media:Cvexp.png]] &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation which is where the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms. At the minima the hanges direction after colliding fully with other atoms &lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518396</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518396"/>
		<updated>2015-12-04T18:09:02Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Heat Capacity Calculation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The decrease in heat capacity at higher temperatures is a result of the non-classical behaviour of the system at low temperatures. The energy levels behave as if they are discrete, the lower the temperature the more discrete they are. As illustrated here, the energy levels are closer together at higher temperatures(&amp;lt;math&amp;gt;T_2&amp;lt;/math&amp;gt;) and further apart at lower temperatures(&amp;lt;math&amp;gt;T_1&amp;lt;/math&amp;gt;). When a heat increment &amp;lt;math&amp;gt;dq&amp;lt;/math&amp;gt; is introduced into the two systems we see that it has a different effect in both. At T2 the dq will give a greater temperature increase than T1, this causes the denominator in the equation below to become more important thus decreasing the isochoric heat capacity.&lt;br /&gt;
&lt;br /&gt;
[[Media:Cvexp.png]] &lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more effectively with a given temperature change than a system with a lower pressure since the atoms are further apart.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation which is where the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms. At the minima the hanges direction after colliding fully with other atoms &lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:CvExp.png&amp;diff=518395</id>
		<title>File:CvExp.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:CvExp.png&amp;diff=518395"/>
		<updated>2015-12-04T18:03:56Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518100</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518100"/>
		<updated>2015-12-04T14:01:05Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation which is where the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms. At the minima the hanges direction after colliding fully with other atoms &lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518093</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518093"/>
		<updated>2015-12-04T13:55:22Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid VACFs are similar but have some important differences. The solid atoms correlation with their initial velocity decreases faster than the liquids. The minima for the solid is much earlier and also much more negative. This happens because the solid atoms are much closer to each other and there are a lot more of them, resulting in an interaction after less time. When the correlation becomes negative it represents and inversed correlation i.e. the velocity is no longer correlated to it&#039;s initial velocity but rather external velocities of other atoms.&lt;br /&gt;
&lt;br /&gt;
 cked structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518049</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518049"/>
		<updated>2015-12-04T13:21:18Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|800px|thumb|right|figure 13]] &lt;br /&gt;
The minima in the VACFs represent a change in the direction of the velocity, this caused by collisions with other atoms. &lt;br /&gt;
&lt;br /&gt;
The liquid and solid plots are similar in general however there are some important differences arising from their physical structures. The solid has a steeper decrease in correlation and so it has an earlier minima than the liquid. This is caused by the tight ordered structure of the solid, other atoms are encountered a lot more quickly since they are closer. Another difference is the deepness of the minima, the solid&#039;s is significantly more negative than the liquid. Again this is due to the solid&#039;s close packed structure, the correlation becomes more negative beause the atoms are tightly constrained and so the interactions are very strong with other atoms. The atoms in the liquid are free moving and so when they collide they can move to stabilise  The decorrelated solid function shows some oscillation about &amp;lt;math&amp;gt;C(\tau)=0&amp;lt;/math&amp;gt; this arises from the jostling with other atoms in the fixed lattice and so we see a sort of harmonic oscillator motion. The liquid does not display this behavior because they are free to move and so will be able to &amp;quot;rapidly destroy any oscillatory motion.&amp;quot;[x] by the &amp;quot;diffusive motion&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518015</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=518015"/>
		<updated>2015-12-04T12:54:30Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero.  &lt;br /&gt;
&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;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
[[File:VACFplots.png|1000px|thumb|right|figure 13]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;br /&gt;
[[File:solid3200.png|800px|thumb|right|figure 14]] [[File:solidM.png|800px|thumb|right|figure 15]] [[File:liquid8000.png|800px|thumb|right|figure 16]] [[File:liquidM.png|800px|thumb|right|figure 17]] [[File:gas8000.png|800px|thumb|right|figure 18]] [[File:gasM.png|800px|thumb|right|figure 19]]&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:GasM.png&amp;diff=518005</id>
		<title>File:GasM.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:GasM.png&amp;diff=518005"/>
		<updated>2015-12-04T12:46:49Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas8000.png&amp;diff=518004</id>
		<title>File:Gas8000.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas8000.png&amp;diff=518004"/>
		<updated>2015-12-04T12:46:26Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: Mcd13 uploaded a new version of File:Gas8000.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:LiquidM.png&amp;diff=518003</id>
		<title>File:LiquidM.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:LiquidM.png&amp;diff=518003"/>
		<updated>2015-12-04T12:46:11Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid8000.png&amp;diff=518002</id>
		<title>File:Liquid8000.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid8000.png&amp;diff=518002"/>
		<updated>2015-12-04T12:45:51Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: Mcd13 uploaded a new version of File:Liquid8000.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:SolidM.png&amp;diff=518001</id>
		<title>File:SolidM.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:SolidM.png&amp;diff=518001"/>
		<updated>2015-12-04T12:45:42Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid3200.png&amp;diff=518000</id>
		<title>File:Solid3200.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid3200.png&amp;diff=518000"/>
		<updated>2015-12-04T12:45:21Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: Mcd13 uploaded a new version of File:Solid3200.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACFplots.png&amp;diff=517999</id>
		<title>File:VACFplots.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACFplots.png&amp;diff=517999"/>
		<updated>2015-12-04T12:45:04Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517985</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517985"/>
		<updated>2015-12-04T12:35:05Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero. &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;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517981</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517981"/>
		<updated>2015-12-04T12:33:18Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fraction can be expanded; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2 \cos(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then since &amp;lt;math&amp;gt;\cos(\omega \tau)&amp;lt;/math&amp;gt; does not contain a t term it can be moved outside of the integral;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau)\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}+\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The alike terms cancel to give;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\cos(\omega \tau) + \frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally &amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty}\cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt} = 0&amp;lt;/math&amp;gt;, this is because &amp;lt;math&amp;gt;sin&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\frac{\cos}{\sin}&amp;lt;/math&amp;gt; are odd functions. When odd functions are integrated between symmetrical boundaries the product is zero. &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;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517962</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517962"/>
		<updated>2015-12-04T12:19:53Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi)}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We also need our velocity as a function of time after &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, this is acheived by substituting in &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the VACF;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity &amp;lt;math&amp;gt; \sin(\alpha + \beta) = \sin(\alpha) \cos(\beta) + \cos \alpha \sin \beta &amp;lt;/math&amp;gt; we can re-write our equation;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517954</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517954"/>
		<updated>2015-12-04T12:12:26Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We must simplify this expression in order for it to be useful, to do this we must first find expressions for &amp;lt;math&amp;gt;v(t)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v(t + \tau)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
The expression for position as a function of time for the HO is defined as;&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;
This can be substituted into the expression of velocity as a function of time; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is then differentiated using the chain rule;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) x \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517808</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517808"/>
		<updated>2015-12-04T11:25:46Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) x \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{-\infty}^{\infty}(\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517783</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517783"/>
		<updated>2015-12-04T11:21:37Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty} \omega A \sin(\omega t + \phi) x \omega A \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty}\omega A \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi) \sin(\omega t + \omega\tau + \phi)\,dt}{\int_{-\infty}^{\infty} \sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517709</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517709"/>
		<updated>2015-12-03T21:15:53Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))\,dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2\,dt} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi \, dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
Comparison and analysis of the solid and liquid VACFs&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;br /&gt;
&lt;br /&gt;
The plots of &amp;lt;math&amp;gt; C(\tau) vs time &amp;lt;/math&amp;gt; of the three phases in a small and large system were plotted along with their running integral.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid3200.png&amp;diff=517562</id>
		<title>File:Solid3200.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid3200.png&amp;diff=517562"/>
		<updated>2015-12-03T20:16:05Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid8000.png&amp;diff=517561</id>
		<title>File:Liquid8000.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid8000.png&amp;diff=517561"/>
		<updated>2015-12-03T20:15:32Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas8000.png&amp;diff=517559</id>
		<title>File:Gas8000.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas8000.png&amp;diff=517559"/>
		<updated>2015-12-03T20:15:14Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517111</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=517111"/>
		<updated>2015-12-03T15:22:54Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: /* Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt; v(t + \tau) = -\omega A\sin(\omega (t + \tau) + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))\,dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2\,dt} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=\frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi \, dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2\,dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt; \omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{ \int_{-\infty}^{\infty}\sin(\omega t + \phi)^2\,dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{\sin(\omega t + \phi)^2 \cos(\omega\tau) + \sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)\,dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position====&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516971</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516971"/>
		<updated>2015-12-03T14:14:33Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;= \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &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;
where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position====&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516966</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516966"/>
		<updated>2015-12-03T14:12:30Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==Theory==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position====&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator models a diatomic atom connected by a spring, the spring expands and contracts in a periodic fashion, resulting in a repetitive back and forth motion which is fixed. The Lennard-Jones potential models the interaction between two atoms, there is an attractive and negative term which are dependent on distance and which are not fixed. This results in a periodic behaviour, where the atom goes from free flight, to zero correlation with a lot of backscattering and then back up to free flight. This periodic nature arises from the fixed springs constrained motion. The lennard-jones atom has a more random behavior, since the interatomic distance is not fixed the correlation is highly dependent on distance. &lt;br /&gt;
&lt;br /&gt;
===Task 19: Integrating using the trapezium rule to get D===&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516925</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516925"/>
		<updated>2015-12-03T13:46:56Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position====&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the constant uncorrelated function since C(t) = 0. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighboring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face-centered lattice and jostles about with it&#039;s nearest neighbors. Where the functions become constant we can see that the solid has fluctuations around it&#039;s uncorrelated function, this arises from atomic vibrations of the close packed atoms; a small fluctuation may also be seen for the liquid, however it experiences less vibrational motion since the atoms are not locked in a tight configuration.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516913</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516913"/>
		<updated>2015-12-03T13:40:07Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: The velocity auto-correlation function(VACF)===&lt;br /&gt;
&lt;br /&gt;
==Evaluating the 1D harmonic oscillator VACF using the expression for the position as a function of time==&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Plotting and analysis of the solid, liquid and harmonic osillator VACFs against position====&lt;br /&gt;
&lt;br /&gt;
=====Comparison and analysis of the solid and liquid VACFs===== &lt;br /&gt;
&lt;br /&gt;
The VACFs for the two simulations in figure 13 have three main features of interest at different distances; the initial part at a minuscule distance is the &#039;&#039;free flight&#039;&#039; part where the function is at 0, this is where there are no restrictive forces this then starts to decay when the atom encounters surrounding atoms decreasing the function. In the solid we can see it starts decaying faster than the liquid, this is due to the higher number of surrounding atoms. The next significant behaviour is at a moderate distance, where the function reaches zero. At zero there are no residual correlations and so at this point the function starts to increase to the uncorrelated function. We can see that it takes the solid a lot less time for the atom to become uncorrelated than the liquid. This is because there is much less random motion in the solid&#039;s ordered structure than the liquid. Another interesting part of the function is the decay into a negative function, this behavior is called back-scattering, where the atom moves about from interactions with neighbouring atoms. The atom in the solid experiences a larger degree of back-scattering, since it is confined to a tight face centred lattice and so jostles about with it&#039;s nearest neighbours.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516509</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516509"/>
		<updated>2015-12-02T22:27:17Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin(\omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty} \sin(\omega t + \phi \sin\omega t + \omega\tau + \phi dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} =&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516507</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516507"/>
		<updated>2015-12-02T22:23:27Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt} &amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin( \omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty}(\sin(\omega t + \phi))(\sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta &amp;lt;/math&amp;gt; &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) + (\cos(\omega t + \phi) \sin(\omega \tau))dt}{ \int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))+(\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = \frac{(\sin(\omega t + \phi)^2 \cos(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} + \frac{\sin(\omega t + \phi) \cos(\omega t + \phi) \sin(\omega \tau)dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} =&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516452</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516452"/>
		<updated>2015-12-02T21:38:26Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep(0.002).&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 4.17 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 5.83E-08 x 10^{-7} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 8.33 x 10^{-2} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 3.09 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 2.43 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin( \omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty}(\sin(\omega t + \phi))(\sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta&amp;lt;/math&amp;gt; &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)+(\cos(\omega t + \phi) \sin(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)((\sin(\omega t + \phi)\cos(\omega\tau)+(\cos(\omega t + \phi)(\sin(\omega \tau)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)(\sin(\omega t)\cos(\omega\tau + \phi)+(\sin(\omega t + \phi)(\cos(\omega t)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516414</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516414"/>
		<updated>2015-12-02T21:10:18Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 2.5 x 10^{-5} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 3.5 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 0.5 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 0/5 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 18.6 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 14.6 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A \sin( \omega t + \phi))( \omega A \sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty}(\sin(\omega t + \phi))(\sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \sin{\alpha + \beta} = \sin{\alpha} \cos{\beta} + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omega t + \phi = \alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega \tau = \beta&amp;lt;/math&amp;gt; &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)+(\cos(\omega t + \phi) \sin(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)((\sin(\omega t + \phi)\cos(\omega\tau)+(\cos(\omega t + \phi)(\sin(\omega \tau)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)(\sin(\omega t)\cos(\omega\tau + \phi)+(\sin(\omega t + \phi)(\cos(\omega t)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516405</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516405"/>
		<updated>2015-12-02T21:05:05Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 2.5 x 10^{-5} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 3.5 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 0.5 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 0/5 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 18.6 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 14.6 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega A\sin(\omega(t + \tau) + \phi) = -\omega A\sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}(\omega A\sin(\omega t + \phi))(\omega A\sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\omega A\sin(\omega t + \phi)^2dt} = \frac{\int_{-\infty}^{\infty}(\sin(\omega t + \phi))(\sin(\omega t + \omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt; \Sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;\omegat + \phi = \alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \omega\tau = \beat&amp;lt;/math&amp;gt; &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)+(\cos(\omega t + \phi)\sin(\omega\tau))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)((\sin(\omega t + \phi)\cos(\omega\tau)+(\cos(\omega t + \phi)(\sin(\omega \tau)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt} = (\sin(\omega t + \phi)(\sin(\omega t)\cos(\omega\tau + \phi)+(\sin(\omega t + \phi)(\cos(\omega t)\sin(\omega\tau + \phi))dt}{\int_{\-infty}^{\infty}(\sin(\omega t + \phi)^2dt}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516357</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516357"/>
		<updated>2015-12-02T20:34:58Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 2.5 x 10^{-5} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 3.5 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 0.5 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 0/5 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 18.6 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 14.6 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function(VACF) using the expression for the position as a function of time===&lt;br /&gt;
&lt;br /&gt;
The normalized VACF is given by;&lt;br /&gt;
&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(t)dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From task 2 we define &amp;lt;math&amp;gt;x(t),/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = A\cos(\omegat + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA\cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omegaA\sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omegaA\sin(\omega(t + \tau) + \phi) = -\omegaA\sin(\omegat + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two velocity expressions are substituted into the velocity autocorrelation function;&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(t)dt}&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516343</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516343"/>
		<updated>2015-12-02T20:11:06Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 2.5 x 10^{-5} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 3.5 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 0.5 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 0/5 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 18.6 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 14.6 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 20: Evaluating the 1D harmonic oscillator velocity autocorrelation function using the expression for the position as a function of time===&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;
&amp;lt;math&amp;gt;v(t) = \frac{dx(t)}{dt} = \frac{dA \cos(\omega t + \phi}{dt}&amp;lt;/math&amp;gt;&lt;br /&gt;
Using the chain rule &lt;br /&gt;
&amp;lt;math&amp;gt; \frac{dx(t)}{dt} = \frac{dx(t)}{du} x \frac{du}{dt}&amp;lt;/math&amp;gt; &lt;br /&gt;
Where &amp;lt;math&amp;gt;u = \omega t + \phi&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;v(t) = -\omega A \sin(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
For &amp;lt;math&amp;gt;v(t + \tau &amp;lt;/math&amp;gt; we let &amp;lt;math&amp;gt;t = t + \tau&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore;&lt;br /&gt;
&amp;lt;math&amp;gt;v(t + \tau) = -\omega \sin(\omega(t + \tau) + \phi) = -\omega \sin(\omega(t) + \omega\tau) + \phi) &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516263</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516263"/>
		<updated>2015-12-02T17:48:20Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
Finding the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
The gradient was found by fitting a linear trendline through the function.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 2.5 x 10^{-5} ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 3.5 x 10^{-6} ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Liquid&lt;br /&gt;
&lt;br /&gt;
Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 0.5 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 0/5 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;br /&gt;
&lt;br /&gt;
Gas&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradient to give time units gave &amp;lt;math&amp;gt;D = 18.6 ms^{-2}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D = 14.6 ms^{-2}&amp;lt;/math&amp;gt; for the 3200 atom simulation.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516257</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516257"/>
		<updated>2015-12-02T17:34:33Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement(MSD) of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&amp;lt;math&amp;gt; MSD(t) = &amp;lt;((t_0 + t)-(t_0))&amp;gt;^2 &amp;lt;/math&amp;gt; where; &amp;lt;math&amp;gt;t_0 =&amp;lt;/math&amp;gt; the initial timestep and &amp;lt;math&amp;gt;t =&amp;lt;/math&amp;gt;the new timestep Equation x&lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{6} \frac{\delta &amp;lt;r^2(t)&amp;gt;}{\delta t}&amp;gt; &amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;D =&amp;lt;/math&amp;gt; the diffusion coefficient in &amp;lt;math&amp;gt;m s^{-2}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;&amp;lt;r^2(t) =&amp;lt;/math&amp;gt; MSD and &amp;lt;math&amp;gt; t =&amp;lt;/math&amp;gt; timestep&lt;br /&gt;
The gradient of the slopes give the diffusion coefficent, however this uses a dimensionless timestep denominator, therefore we must convert it to time units by dividing by the timestep.&lt;br /&gt;
&lt;br /&gt;
Solid&lt;br /&gt;
&lt;br /&gt;
A trendline was fitted to the function, since the simulation took some time to produce the linear behavior it was fitted to be linear with the latter part of the function. Conversion of the gradients units gave &amp;lt;math&amp;gt;D = 2.5 x 10^-{5}&amp;lt;/math&amp;gt; for the million atom simulation and &amp;lt;math&amp;gt;D =&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516244</id>
		<title>Rep:Mod:IOPJKL</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:IOPJKL&amp;diff=516244"/>
		<updated>2015-12-02T17:17:43Z</updated>

		<summary type="html">&lt;p&gt;Mcd13: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&#039;&#039;&#039;Liquid Simulations Computational Experiment&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;&#039;Theory&#039;&#039;&#039;==&lt;br /&gt;
&lt;br /&gt;
===Task 1: Calculations of a Harmonic Oscillator using both Classical and Velocity-Verlet solutions===&lt;br /&gt;
[[File:All3graphs.png|800px|thumb|right|&#039;&#039;Figure 1.a) Positions calculated via the two solutions vs time b) Difference between the positions calculated via different methods against time c) Total energy of the harmonic oscillator calculated using Velocity-Verlet solutions vs time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position calculations from the two methods&#039;&#039;&#039;: The position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; was determined using  &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;. These were plotted against time(Figure 1.a).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Error analysis of the two positions&#039;&#039;&#039;: The difference between the two positions was calculated and plotted against time(Figure 1.b). The error increases with time and position, this loss of precision could come from two sources. As the position gets further from the original position the &amp;lt;math&amp;gt;a(t)dt^2&amp;lt;/math&amp;gt; part of the equation has less importance [x] also the errors could build up since the previous position is used in the preceding position calculation. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Total Energy of the Harmonic-Oscillator vs time&#039;&#039;&#039;: Values for velocity &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; and position &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; were obtained from the Velocity-Verlet calculation, values for the force-constant &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; and mass &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; were both given as 1. Using ,math&amp;gt; E= \frac{1}{2}mv^2 + \frac{1}{2}kx^2&#039;&#039; the total energies were calculated and plotted against time(Figure 1.c).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 2: Plot of maxima error positions vs time===&lt;br /&gt;
The coordinates of the 5 maximas in figure 2 were estimated and plotted on a new graph. This yielded a linear function where &amp;lt;math&amp;gt;x(t) = 0.0004x - 7*10^{-5}&amp;lt;/math&amp;gt;. [[File:MaximaDiff.png|200px|thumb|right|&#039;&#039;Figure 2. Linear plot of the maxima error positions(figure 1.b) against time &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 3: Timesteps to minimise variation in total energy===&lt;br /&gt;
&lt;br /&gt;
Multiple timesteps were used to calculate the total energy of the harmonic oscillator. The percentage difference was taken between the initial energy assumed to be correct and the energy of the first minima, these results were then plotted(figure 3). In order to keep the change in total energy below 1% a timestep equal to or below 0.2 should be used. The change in total energy of the simulation should be kept to a minimum as the total energy should not vary over time in the harmonic oscillator.[[File:%vstimestep.png|200px|thumb|right|&#039;&#039;Figure 3. Plot of percentage energy difference and timestep&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 4: Lennard-Jones interaction===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Calculation of distance at zero-potential, r = r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&lt;br /&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
 where φ = potential energy r = the distance ε = well depth and σ = distance from zero potential distance&lt;br /&gt;
                                 &amp;lt;math&amp;gt;\phi\left(r_0\right)= 4\epsilon \left( \sigma^{12} - \sigma^6 r_0^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( 1 - \frac{r_0^6}{\sigma^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;=  1 - \frac{r_0^6}{\sigma^6} = 0 &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;
2. &#039;&#039;&#039;Force at r&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;:&#039;&#039;&#039;&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} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_0} 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 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;
Since &amp;lt;math&amp;gt;\sigma = r_0 &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon\left( -12\frac{\sigma^{12}}{\sigma^{13}} + 6\frac{\sigma^6}{\sigma^7} \right) = 4\epsilon\frac{-6}{\sigma} = -\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3. Finding the equilibrium separation &#039;&#039;r&amp;lt;sub&amp;gt;eq&amp;lt;/sub&amp;gt;:&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\mathbf{F}_{eq} = - \frac{\mathrm{d}\phi\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_{eq}} = - \frac{\mathrm{d}}{\mathrm{d}\mathbf{r}_{eq}} 4\epsilon \left( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right) = 4\epsilon \left( -12\frac{\sigma^{12}}{r_{eq}^{13}} + 6\frac{\sigma^6}{r_{eq}^7} \right) = -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;
:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\frac{\sigma^{12}}{r_{eq}^{13}}\right) = \epsilon \left(\frac{\sigma^6}{r_{eq}^7} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{12}\right) = \epsilon \left(\sigma^6 r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\epsilon \left(\sigma^{6}\right) = \epsilon \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;2\left(\sigma^{6}\right) = \left(\ r_{eq}^6 \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\sqrt[6]{2}\sigma =  r_{eq}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;4. Finding the well-depth at equilibrium:&#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) = 4\epsilon \left( \frac{\sigma^{12}}{(\sqrt[6]{2}\sigma)^{12}} - \frac{\sigma^6}{(\sqrt[6]{2}\sigma)^6} \right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right) = 4\epsilon \left( \frac{-1}{4}\right) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5. Evaluation of integrals:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
a) &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;\int_{2}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_2^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2)^{11}} - \frac{1}{-5(2)^5} \right) = -24.82 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
b) &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;\int_{2.5}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{2.5}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= [4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{2.5}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;= 4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(2.5)^{11}} - \frac{1}{-5(2.5)^5} \right) = -8.18 KJ/mol &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
c) &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;\int_{3}^\infty \phi\left(r\right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1^{12}}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r = \int_{3}^\infty 4\epsilon \left( \frac{1}{r^{12}} - \frac{1}{r^6} \right)\mathrm{d}r&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;[4\epsilon \left( \frac{1}{-11r^{11}} - \frac{1}{-5r^5} \right)]_{3}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;4\epsilon \left( \frac{1}{-11(\infty)^{11}} - \frac{1}{-5(\infty)^5} \right) - 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right)&amp;lt;/math&amp;gt; &lt;br /&gt;
:&amp;lt;math&amp;gt;= -0 + 4\epsilon \left( \frac{1}{-11(3)^{11}} - \frac{1}{-5(3)^5} \right) = -3.29 KJ/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 5: Estimating the number of molecules in volumes of H&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;O===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Number of molecules in 1mL:&#039;&#039;&#039;&lt;br /&gt;
:&amp;lt;math&amp;gt;  Mr(H^2O) = 18.02g/mol,\rho = 1g/cm^3 &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m}{Mr} = \frac{1}{18.02} = 5.55x10^{-2}&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;Number of molecules = 5.55x10^{-2} x 6.022x10^{23} = 3.34192x10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Volume of 1000 molecules:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{1000}{6.022x10^{23}} = 1.66x10^{-21} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;m = 1.66x10^{-21} x 18.02 = 2.99x10^{-20}g&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;V = \frac{2.99x10^{-20}}{1} = 2.99x10^{-20}cm^3&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 6: Periodic boundary conditions===&lt;br /&gt;
&lt;br /&gt;
When the atom at &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt; in the cubic simulation box(&amp;lt;math&amp;gt;(0,0,0,) to (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; it ends up at &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt; (when the periodic boundry condition is taken into consideration).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 7: Converting reduced values to real values:===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Reduced distance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; r* = 3.2 = \frac {r}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt; r = 3.2 x 0.34x10^{-9} = 1.09x10^-9 = 1.09nm &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Well-depth&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac {\epsilon}{K_B} = 120K &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\epsilon = 120K_B = \frac {8.69x10^{24}}{6.022x10^{23}} =  997.71 J/mol = 9.98x10^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;Temperature&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; T^* = 1.5 = \frac {K_BT}{\epsilon} &amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;T = \frac {T^* \epsilon}{K_B} = \frac {1.5 x 1.657x10^{-21}}{K_B} = 180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Task 8: Problems with random starting coordinates in non-solid simulations===&lt;br /&gt;
&lt;br /&gt;
If atoms were given random starting coordinates then they could end up within a contact proximity, they could bump into each other and then they would not only experience the potential of each but also the kinetic energy.  &lt;br /&gt;
&lt;br /&gt;
===Task 9: The number density of lattice points calculations:===&lt;br /&gt;
&lt;br /&gt;
The number density &#039;&#039;n&#039;&#039; is given by the following equation&lt;br /&gt;
&amp;lt;math&amp;gt; n = \frac {N}{V}&amp;lt;/math&amp;gt; where N is the number of atoms/lattice points per unit cell and V is volumes of the unit cell.&lt;br /&gt;
&lt;br /&gt;
1. The number density of a simple cubic lattice with inter lattice point distance of 1.07722&lt;br /&gt;
&lt;br /&gt;
For a simple cubic lattice there is one atom/lattice point, using equation x&lt;br /&gt;
:&amp;lt;math&amp;gt; n = \frac {N}{V} =  \frac {N}{r^{*3}} = \frac {1}{1.07722^3} = 0.8 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Side length of a face-centred cubic lattice with a number density of 1.2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A face-centred cubic lattice has 4 atoms/lattice points.&lt;br /&gt;
&amp;lt;math&amp;gt; r^* = \sqrt[3]{V} = \sqrt[3]{\frac {N}{n}} = \sqrt[3]{\frac {4}{1.2}} = 1.49380 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 10: How many atoms are created by create_atoms 1 box command for a face-centred cubic lattice?===&lt;br /&gt;
Since there are 4 atoms per lattice and the box is ten lattice spacings larger than the single lattice spacing then there would be 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 11: LAMMPS commands for setting the properties of atoms:===&lt;br /&gt;
&lt;br /&gt;
1. Mass command&lt;br /&gt;
&lt;br /&gt;
 mass &#039;&#039;I&#039;&#039; &#039;&#039;value&#039;&#039; = mass 1 1.0  &lt;br /&gt;
This command is used for setting the mass of the atom, in the general command I is the atom type and value is the mass(in reduced units). In the example the atom is type 1 and the mass is 1.0.&lt;br /&gt;
&lt;br /&gt;
2. Pair_style command&lt;br /&gt;
&lt;br /&gt;
pair_style style args = pair_style lj/cut 3.0 &lt;br /&gt;
&lt;br /&gt;
The pair_style command is used to describe paired interactions, style is the interaction which is being looked at and args is the argument used for that style. In the example above the style is defining the cutoff distance, that is the distance at which interactions become negligible. The argument for the cutoff distance is 3.0, after which the simulation will not compute. &lt;br /&gt;
&lt;br /&gt;
3. pair_coeff command&lt;br /&gt;
&lt;br /&gt;
pair_coeff &#039;&#039;* * args&#039;&#039; = pair_coeff * * 1.0 1.0&lt;br /&gt;
This command is used to define the force field coefficients between pairs of atoms, the asterix terms are to define the coefficients for all atoms, the second part of this command, args, defines the coeffecients.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Specifying the velocity of each atom===&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet algorithm is used to specify velocity and position&lt;br /&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 \ \ (9)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 13: Running the simulation:===&lt;br /&gt;
The command $(100/timestep) command allows for the immediate evaluation of the the formula with the pre-defined variable i.e. the timestep. The following line variable n_steps equal floor(100/$({timestep}) will be broken down into individual contributions. The variable component is used to allows for the return to re-run a command, this allows creates a loop. The n_steps part describes the number of timesteps you wish to calculate which is defined in the &#039;Run Simulation&#039; command. Equal is used to create a mathematical argument. Floor(11/$({timestep}) is useful in setting the maximum timestep bigger than the original one. In the run simulation part first we define the number of timesteps to be considered and then report the floor value i.e. the total time it takes. These lines are essential in creating a loop where each new timestep may be calculated subsequently. &lt;br /&gt;
Make it easier to change the timestep, all values dependedent on the timestep will be changed with it and so it reduces possible human errors when changing all variables and also makes it easier and faster. &lt;br /&gt;
&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
===Task 14: Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
1. Pressure, Temperature and energy against time for simulation ran at 0.001 timestep&lt;br /&gt;
&lt;br /&gt;
PIC fig 4&lt;br /&gt;
&lt;br /&gt;
2. Equilibration&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibration at approximately 0.28, this is the timestep at which the simulation becomes relatively constant.&lt;br /&gt;
&lt;br /&gt;
3. Maximising results accuracy whilst keeping the timestep within a reasonable timescale&lt;br /&gt;
The best timestep for maximum accuracy and sufficient information is 0.0025. It overlaps with 0.001 and so although it is more than twice the time as 0.001 it maintains a satisfactory level of accuracy. The others give equilibrium energies which are too far off the most accurate value, with the worst being for 0.01 as it diverges quite dramatically.&lt;br /&gt;
&lt;br /&gt;
[[File:Energyplotsvstime.png|400px|thumb|right|&#039;&#039;Figure 5. The energy vs time plots of simulations with varying timesteps &#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
&lt;br /&gt;
===Task 15: Finding the expression for factor &amp;lt;math&amp;gt; \gamma &amp;lt;/math&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma&amp;lt;/math&amp;gt; is a factor by which the velocity can be corrected. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt; (1)&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt; (2)&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;T&#039;&#039;&#039; is the target temperature and &#039;&#039;T&#039;&#039; is the instantaneous temperature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i v_i^2 = \frac {3}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_iv_i^2 = \frac {1}{2}NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  m_iv_i^2 = NK_BT &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i^2 = \frac {NK_BT}{m_i} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;  v_i = \sqrt[2]{\frac {NK_BT}{m_i}} &amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Insert v_i into equation x &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} \sum m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {3}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \frac {1}{2} m_i \gamma^2 \frac {NK_BT}{m_i} = \frac {1}{2}NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2NK_BT = NK_BT&#039; &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {NK_BT&#039;}{NK_BT} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 = \frac {T&#039;}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma = \sqrt[2]{\frac {T&#039;}{T}} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 16: The importance of number, repetition and frequency of average calculations with timesteps===&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 sets the number of timesteps after which another thermodynamic value is used to calculate the average, 1000 is the number of thermodynamic values which are used for the average and 1000000 sets the frequency at which averages are calculated. &lt;br /&gt;
&lt;br /&gt;
100000 timesteps will be run.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Task 17: Equation of state plots===&lt;br /&gt;
&lt;br /&gt;
5 temperatures above the critical temeperature were chosen(1.6, 1.8, 2.0, 3.0 and 5.0) these were all simulated with a pressure of 2.6(&#039;&#039;n-1&#039;&#039;) and also 3.3(&#039;&#039;n-2&#039;&#039;). The timestep chose was 0.01 as in previous experiments it was the largest timesteps yielding the most accuracy. &lt;br /&gt;
The pressures were plotted against the temperatures along with their error bars.  &lt;br /&gt;
&lt;br /&gt;
The ideal gas densities were calculated with the following equation:&lt;br /&gt;
&amp;lt;math&amp;gt; \rho = \frac {N}{V} = \frac {P}{K_BT} = \frac {P}{T} &amp;lt;/math&amp;gt; where K_B = 1 in reduced terms&lt;br /&gt;
[[File:DensityvsT.png|400px|thumb|right|&#039;&#039;Figure 6. Densities n-1 and n-2 calculated via simulation and Ideal Gas methods plotted against temperature&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than that of the ideal gas method, this can be explained by an assumption to satisy an ideal gas. The atoms must not have any forces upon them and also they mustn&#039;t take up any space. In the simulation the atoms do take up space and therefore they have a lower density. This discrepancy increases with pressure. The general trend of the two plots is a decrease in heat capacity as temperature is increased. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
&lt;br /&gt;
===Task 18: The temperature dependence of the isochoric heat capacity=== &lt;br /&gt;
[[File:CvVcommand.png|400px|thumb|left|&#039;&#039;Figure 7. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
A LAAMPS script which could calculate the isochoric heat capacity from calculated thermodynamic values was used figure 7. The Cv/V calculation was done using equation x. &lt;br /&gt;
&lt;br /&gt;
[[File:CvVvsT.png|400px|thumb|right|&#039;&#039;Figure 8. Cv/V as a function of T* at P= 0.2 and 0.8&#039;&#039;]]&lt;br /&gt;
The heat capacity represents the ability to transfer heat for a given temperature or how much energy will effect a given temperature. &lt;br /&gt;
&lt;br /&gt;
The general decrease of Cv/V vs T is what would be expected. At a higher temperature the energy levels are closer together and at a lower temperature they are further apart. A heat increment will have a greater effect on the higher temperature system, it will cause a greater temperature change since more energy levels are accessible, resulting in a low heat capacity. At a lower temperature the same heat increment that caused a large temperature change at higher temperature will not have the same effect, less energy levels are accessible and so the heat capacity will be higher.&lt;br /&gt;
&lt;br /&gt;
The difference between the two pressured systems in &#039;&#039;figure 7&#039;&#039; is what would be expected, the higher pressure plot has a higher isochoric heat capacity. At a higher pressure the atoms are closer together, they can thus transfer heat more efficiently with a given temperature change than a system with a lower temperature since the atoms are further away.&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
===Task 18: The Radial Distribution Functions of a solid, liquid and gas===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;1. Comparisons of the solid, liquid and gas radial distributions functions as well as the integrated function &#039;&#039;&#039;&lt;br /&gt;
[[File:rdfslg.png|400px|thumb|left|figure 9]]&lt;br /&gt;
[[File:rdfint.png|400px|thumb|left|figure 10]]&lt;br /&gt;
&lt;br /&gt;
The distribution plot(figure 9) of the gas has one short, broad peak which is close to the reference atom; as you move further away the distribution becomes constant. This characteristic shows the small probability of finding an atom close to the reference atom; also when it becomes constant this shows how there is negligible probability of finding another atom at the distance studied. When looking at the integrated function(figure 10), it emphasizes how few atoms you will find in the distance, this is characteristic of a gas&#039; dispersed atoms.&lt;br /&gt;
&lt;br /&gt;
The liquid&#039;s distribution has a taller first peak than the gas&#039; and then multiple peaks tapering off as you move further away; it is evident that there is a higher probability of finding an atom throughout the space than in a gas. Additionally the integrated distribution(figure 10) shows a larger number of atoms as you move through the space. This demonstrates the higher proximity of the atoms in the liquid state.&lt;br /&gt;
&lt;br /&gt;
Finally the solid&#039;s distribution has a very sharp and tall peak close to the reference atom but then as you move further away the peaks become smaller but continuously fluctuate. The sharpness of the peaks and their continuous distribution arise from the highly ordered structure of the solid. The peaks are sharp unlike the gas and liquid because all of the atoms are in fixed positions and so at a certain position there will be a number of atoms in an equivalent position around the sphere of the distribution function. Futhermore the solid&#039;s first peak is considerably larger than the other phases, the probibility is much greater sdue to the closeness of the atoms. The integrated function shows a very large number of atoms in the space, this again illustrates the closeness of the atoms in the solid state. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2. Using the solid RDF to extract information on the lattice structure&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:rdf3d.png|200px|thumb|right|figure 11]] &lt;br /&gt;
&lt;br /&gt;
The three first peaks of the solid&#039;s radial distribution function are distances 1.0, 1.5 and 1.8. The lattice spacing is 1.5 and the calculated distances r&amp;lt;sub&amp;gt;a&amp;lt;/sub&amp;gt;, r&amp;lt;sub&amp;gt;b&amp;lt;/sub&amp;gt; and r&amp;lt;sub&amp;gt;c&amp;lt;/sub&amp;gt;(where r is the distance from the reference atom to the atoms a, b and c) were found to be 1.0, 1.5 and 1.8(respectively). Therefore the first three peaks 1, 2 and 3 correspond to the lattice points a, b and c(respectively). &lt;br /&gt;
&lt;br /&gt;
The coordination of atom a, b and c is 12, 6 and 24(respectively). These values were interpolated from the magnification of the integrated solid distribution function. &lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
&lt;br /&gt;
===Task 19: The mean squared displacement of large and small simulations===&lt;br /&gt;
&lt;br /&gt;
[[File:msdslv.png|800px|thumb|right|figure 12]] &lt;br /&gt;
&lt;br /&gt;
The mean squared displacement(equation x) is a measure of how much random motion there is within the system. In this simulation the ability to move randomly is determined by the amount of free space and therefore the density. In the gaseous phase there is a lot of free space, the atoms move freely and encounter only a small number of atoms to collide with thus impeding it&#039;s motion; the linear increase of the plot reflects this behaviour. The liquid has a lower degree of random motion than the gas, due closer proximity of the atoms, forces such as drag will now effect the atom&#039;s motion as it moves past other atoms. The two first plots show that the atom is able to move in drift, however the liquid experiences more drag and has a smaller gradient. The solid displays the least amount of translational freedom, the close packed structure prevents any random translational motion; it does however show some random movement, arising from vibrations of the constrained atoms. Therefore the plots in figure 12 are a reasonable representation of the random movement of the three phases.&lt;/div&gt;</summary>
		<author><name>Mcd13</name></author>
	</entry>
</feed>